| Reply | « Previous Thread | Next Thread » |
|
Hi 2 all!
I made test, where creating mutable image: img = Image.createImage(392, 392) and making some scroll of that image (30 seconds for stable result) and min/max memory usage count in this time Memory taken buy image very small!!! : (runtime.totalMemory()-runtime.freeMemory()) ~ 28kb WHY? I know that memory values (by runtime) not true, but difference between them near true value 392x392=153664 (only in 1 byte on color!) - it's more than 28Kb! And 28Kb takes all midlet (created mutable image, loaded png tileset for fill image, midlet code) So, maybe memory compressed or something else? |
|
Which device? Some devices will allocate space for images outside the Java heap, using some native operating system resource, so the image does take memory, but the memory does not appear in the Java memory figures.
Graham. |
| grahamhughes |
| View Public Profile |
| Find all posts by grahamhughes |
|
Tested on S60 (N-Gage, 7650, etc)...
I want to know: on Series 40 where jar limit 64k & mem limit 200k - can I create so big images (more 200k what avalibale from java) or 200k limit - it's total phone limit? I can attach test and any who want can past results |
|
The N-Gage, like other Series 60 devices, has a dynamic heap. The machines have up to several megs of memory, but not all of it is allocated to the JVM on startup. If the JVM needs more memory then more memory is allocated. This means that the memory monitoring can return strange effects where using a lot of memory can actually give you even more free memory than before, because you used all the available memory and the JVM asked the system for more.
shmoove |
|
A agree with you BUT:
If we use runtime.totalMemory() - that value CAN dynamicaly changes. And for exaple, on start aplication (when only midlet and some classes created) we can have 68Kb of memory, but when we loaded resources we can have more - 384Kb total. And when we loaded level with more data than previews - we can got total 1Mb. So runtime.totalMemory() returns NOT constant value for midlet lifecycle... |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|