You Are Here:

Community: Developer Discussion Boards

#1 Old Why createImage(x, y) takes so small memory? - 2005-03-10, 09:44

Join Date: Jan 2005
Posts: 21
Creator3D
Offline
Registered User
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?
Reply With Quote

#2 Old 2005-03-19, 19:02

Join Date: Jun 2003
Posts: 4,322
Location: Cheshire, UK
grahamhughes's Avatar
grahamhughes
Online
Forum Nokia Champion
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.
Reply With Quote

#3 Old 2005-03-19, 21:10

Join Date: Jan 2005
Posts: 21
Creator3D
Offline
Registered User
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
Reply With Quote

#4 Old 2005-03-20, 11:58

Join Date: Mar 2003
Posts: 2,280
Location: Israel
shmoove
Offline
Forum Nokia Champion
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
Reply With Quote

#5 Old 2005-03-22, 17:07

Join Date: Jan 2005
Posts: 21
Creator3D
Offline
Registered User
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 With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ