You Are Here:

Community: Developer Discussion Boards

#1 Old Series40 Heap Memory - 2005-06-10, 09:18

Join Date: Apr 2005
Posts: 39
metebalci
Offline
Registered User
I am having troubles with heap memory on Series40, so I begin to evaluate some tests.

I wrote a simple midlet with a canvas class. It paints freeMemory and totalMemory on screen. That is all.

Jar size is: 1.87KB
Midlet.class : 823 Bytes
MyCanvas.class : 1433 Bytes

There is only one "new" in midlet to create a MyCanvas instance, and MyCanvas has only one member for holding a reference back to the midlet.

When I run the application on a Series40 phone (specifically it is a 3200 I think, I am lost in all those numbers), it displays:

FreeMemory: 188148
TotalMemory: 215040

Total Memory is consistent with the specified figure of 210K. However I dont understand the reason why free memory is 188148. I almost allocate nothing. Where does 27K go ? Is it for JVM or some internals ? Will I always start with a heap around 190K ?

Thanks in advance.

MB
Reply With Quote

#2 Old 2005-06-17, 18:11

Join Date: Jan 2005
Posts: 21
Creator3D
Offline
Registered User
My observations:

Same midlet (big, ~64Kb jar, many graphics) takes different memory on phones and emulators to(! they show realy memory on that phones):

SE T6xx: 170Kb
Samsung C100: 275Kb
Nokia S40 (7210, 6100): ~350Kb

All values on emulators and devices, exclude S40, because it's not fit in to memory, so only emulator + real device but with cut data for check

So, S40 devices (and may be other series?) uses memory VERY not efficiently.

Best results on SE. We can build MORE BETTER game, for example, on that device not look at 256Kb heap limit (in realy used only 180Kb)! But that game can't be run on S40 at all.
And if remember about better jar limits on SE...
Nokia, what happens? May be better use some special techniks for save memory?
Reply With Quote

#3 Old 2005-06-17, 20:24

Join Date: Mar 2003
Posts: 2,280
Location: Israel
shmoove
Offline
Forum Nokia Champion
With the SE phone you have to take into account that it has 80KB of video memory to load images into. That could easily explain the big difference.

And in reply to both posts: remember that the KVM will also consume memory for it's methods. With a Canvas a call to paint() needs a Graphics context, the lifecycle methods in the MIDlet class probably create a few objects for their own use, etc.

Another thing that might cause differences between phones is the format they use to store their images. I am not that familiar with the Samsung C100 though, how many colors does the screen have.

shmoove
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