×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Excessive midlet memory consumption

    I'm having trouble with excessive memory consumption in my J2ME program (so nothing new I guess) and here is the situation: seems like the more available memory a cellphone has the more memory program takes. Program alone is runnable quite fine with different memory configurations but when other programs are being loaded (like calendar) on top of the midlet it just quits without any prompt. So I guess its out of memory problem. I have inspected the available memory using 3rd party programs like TaskSpy. For example when Nokia E70 is being used my program takes a whopping 6 mb memory on load and another 6 mb on running. On Nokia 6630 it takes 2,5 mb on load and maybe some 1 mb on running. Netbeans memory profiler shows 500 kb spike on load and steady 300-400 kb consumption when running which seems much more reasonable figures considering the relative simplicity of the program. The program must be able to run in background and the user has to be able to use basic phone functions like calendar.

    Does anyone have any idea what is the reason behind this "dynamic" memory consumption and how it could be mastered? Is it possible to e.g. restrict the KVM sandbox size to specific maximum limit? I doubt, but is it sensible to observe free memory with Runtime.freeMemory() and then use gc() when memory has dropped to specific level? Runtime.freeMemory() doesn't seem to give very reliable results and gc() is seemingly no magic word for memory related problems.

    My program size is about 160 kb obfuscated. It has 20.000 LOC + 500 lines of localization data in 22 classes. Image/audio data is 40 kb. Maximum of 2 threads is run simultaneously. My recordstore contains data only a few thousand characters. I know the basic memory optimization tricks but I havent gone as far as memory pooling because I don't believe memory fragmentation is problem.

  2. #2
    Registered User
    Join Date
    Nov 2003
    Posts
    5

    Re: Excessive midlet memory consumption

    At least firmware upgrade in E70 from 1.x to 3.x helped memory management a bit. E90 seems to have enough free memory anyways to run multiple "big" applications in background. However, I guess I have to settle however OS decides to manage memory and hope it is sufficient.

Similar Threads

  1. getting CPU time and memory consumption
    By wlaifa in forum Symbian
    Replies: 0
    Last Post: 2007-04-19, 11:19
  2. N70 'Memory Full' error using J2ME, Bluetooth and TCP
    By scoobyboy in forum Mobile Java General
    Replies: 3
    Last Post: 2006-12-06, 22:21
  3. Bluetooth SPP - buffers & memory question
    By asmatic in forum Bluetooth Technology
    Replies: 3
    Last Post: 2006-12-06, 21:57
  4. midlet out of memory
    By cristescupetru in forum Mobile Java General
    Replies: 0
    Last Post: 2004-01-21, 15:01
  5. Idea about securing MIDlet
    By falconi in forum Mobile Java General
    Replies: 0
    Last Post: 2003-11-11, 00:36

Posting Permissions

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