Categories: Java | Java ME | How To | Code Examples | Optimization
This page was last modified 08:44, 27 November 2007.
How to find out the free memory in Java ME
From Forum Nokia Wiki
The free memory is retrieved using the following code
Runtime runt=Runtime.getRuntime(); long freeMemory = runt.freeMemory();
This method however doesn't return all available possible memory in all Java VM implementations like in S60. S60 uses a VM in allocates it's VM heap memory dynamically from operating system. During startup certain amount of heap is reserved but when the memory will be used and the free amount is becoming smaller VM dynamically allocates more heap from OS. The VM also releases unnecessary heap back to operating system. This kind of implementation is important in operating environment with true multitasking capabilities like S60.
In S60 3rd Edition devices there is a system propertycom.nokia.memoryramfree
that can be used to query the available RAM available in the operating system. This is much more reliable estimate of available RAM. Although it should be understood that any other application may use this RAM.
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Where to find the downloaded file | guna_cbe | General Browsing | 3 | 2006-06-20 15:22 |
| java memory 6610 7210 | vegetaleb | Mobile Java General | 0 | 2003-06-07 12:27 |
| memory RAM and memory Free RAM for series 60 phones | deepakcn | General Symbian C++ | 1 | 2006-01-04 13:57 |
| Sms & java | kentguy07 | Mobile Java General | 11 | 2008-01-31 17:41 |
| Memory Leak in Req_Sms_Read | simsamuk | Multimodecards | 2 | 2003-04-07 08:53 |
