×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    out-of-memory-exception and senseless values calling "freeMemory()" on an "Nokia C5"

    Hello!

    I have a problem with an "Nokia C5":
    I got out-of-memory-exceptions after 2 hours running an application that works fine non-stop for days with "Nokia 6110 Navigator", "SE W760i".

    I tried "Runtime.getRuntime().freeMemory()" and "Runtime.getRuntime().totalMemory()" to find out where the leak is.
    But I get senseless value:

    -free memory start with x bytes, total memory start with y bytes
    -the amount of free memory goes down
    -free memory makes a jump to a higher value than x (total memory makes also a jump to a higher value than y)
    -the amount of free memory goes down
    and so on...

    The peaks of total memory and free memory becomes higher and higher.

    With this values I'am unable to find out were the leak is.

    Who can help?

    Best regards

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: out-of-memory-exception and senseless values calling "freeMemory()" on an "Nokia

    The peaks of total memory and free memory becomes higher and higher.
    This is because of dynamic allocation of heap memory on C5 for your j2me app.

    You app has a memory leak in some thread, as you see the amount of free memory going down over a period of time - which is harmful on any device with any finite heap memory.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: out-of-memory-exception and senseless values calling "freeMemory()" on an "Nokia

    Please tell us more about the operation you are performing inside the app,are you using any third party API like LWUIT, J2ME Polish etc.
    Also the app's run() code will be of major concern in these kind of situations, so kindly share the run() of your app.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Registered User
    Join Date
    Jun 2010
    Posts
    14

    Re: out-of-memory-exception and senseless values calling "freeMemory()" on an "Nokia

    Thanks for the responses.
    But my application is very comlex.
    I has file-io, ftp-communication and calls to the location-api.
    Therefore it will be a hard work for me to find the leak.

    But I think I can handle this if I have a "tool".
    But the values I get from "Runtime.getRuntime().freeMemory()" and "Runtime.getRuntime().totalMemory()" are senseless.
    The "realy" amount of total memotry can't grow!
    The amount of free memory goes up and down, and if I frequently call "System.gc()" it is always high and nevertheless I get an out-of-memory-exception ,with free memory!

    Who can tell me something about the senseless values "Runtime.getRuntime().freeMemory()" and "Runtime.getRuntime().totalMemory()"?
    Does someone else have these senseless values, or not?
    Are there any other functions to call?

  5. #5
    Super Contributor
    Join Date
    Mar 2008
    Location
    The Capital of INDIA
    Posts
    4,328

    Re: out-of-memory-exception and senseless values calling "freeMemory()" on an "Nokia

    I have face the same situation on various devices. On S60 devices or the newer device the allocation of the memory is dynamic and hence will be handle by the underlying operating system.
    What you can do is, run the application with the WTK's memory monitor and check that what kind of variable and objects are leading you out of memory.
    May This URL have some information of your interest.

    You can not trust blindly on the Runtime that it will always give you the accurate and exact values for the memory.
    Thanks with Regards,

    R a j - The K e r n e l


    Join Delhi-NCR Nokia Developer's Community,

Similar Threads

  1. problem in installing java-program on "Nokia C5"
    By gutesoftware_krause in forum Mobile Java General
    Replies: 2
    Last Post: 2010-06-14, 15:37
  2. Replies: 3
    Last Post: 2009-06-18, 21:42
  3. Calling cards: Replace "+" with "00" in case of dialling contacts via DTMF
    By cgalli in forum General Development Questions
    Replies: 1
    Last Post: 2007-08-30, 22:01
  4. "The instruction at "0x0043c30e" referenced memory at "0x00000044".
    By viswanadhr in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-11-08, 07:51

Posting Permissions

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