Categories: Java | Java ME | How To | Code Examples | Optimization
This page was last modified 08:45, 27 November 2007.
How to find out the total memory in Java ME
From Forum Nokia Wiki
The current total heap memory of VM is retrieved using the following code
Runtime runt=Runtime.getRuntime(); long totalMemory = runt.totalMemory();
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 |
| memory leak | sandy_zeng | General Symbian C++ | 5 | 2007-08-08 09:46 |
| Java or C++ - what is the preferred choice for Symbian` | larry_ger | General Symbian C++ | 10 | 2004-07-14 12:40 |
| Reading MediaContent and converting into B64 | amitaggarwal | Mobile Java Media (Graphics & Sounds) | 3 | 2008-06-03 13:36 |
| Application to launch URL | koool91270 | WRT Widget Development | 2 | 2007-10-11 14:03 |
| Memory management for the Nokia 5140 (Flash organisation) | digitalmatter | General Discussion | 0 | 2005-07-28 11:45 |
