×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2008
    Posts
    37

    Angry Memory Available to JVM is too small...

    Hello There ... !!


    I write a small application to figure out how much free memory is available
    Code:
    display.setCurrent(new Alert("Free Memory, Total Memory ", "Free  Memory=" +String.valueOf(Runtime.getRuntime().freeMemory()/1024) +" KB And Total Memory Memory=" +String.valueOf(Runtime.getRuntime().totalMemory()/1024) +" KB", null, AlertType.INFO) , lt);
    The Result was on Nokia N95
    Free Memory=250 KB And Total Memory= 500 KB
    I was surprised to see this result.......

    I was asuming that I have atleast 2MB for Java JVM.....


    Can I increse this memory size......

    However Storage Memmory is more than 100 MB on Phone Memory...

    Comment are welcomed on this issue.....
    Huzefa

  2. #2
    Nokia Developer Champion
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Memory Available to JVM is too small...

    try to make an object which needs more space, like a 300x300 pixels Image (empty)...
    U will notice that the JVM will dynamically allocate more or less memory depending on its own expectattions of whats needed..

    So the numbers u are mentioning are NOT constant ! Not even on the same mobile !

  3. #3
    Registered User
    Join Date
    Jan 2008
    Posts
    37

    Re: Memory Available to JVM is too small...

    Okay....


    But I am try to store create a buffer of 50 KB byte array...
    then it is not supporting at all ....

    I have a write which read the 50KB of data from the file and writes it to the HttpOutputStream.....but when I try to do it my application terminates .... automatically without any exception..

    And

    When the same thing I tried to do, with 10KB it is working...

    then why it is happening so........
    Huzefa

  4. #4
    Nokia Developer Expert
    Join Date
    Aug 2007
    Posts
    1,595

    Re: Memory Available to JVM is too small...

    Hello Huzefa,

    I write a small application to figure out how much free memory is available

    Code:..
    Based on the code, you're using

    Runtime.getRuntime();

    which could be the reason for the dubious memory info. Usage of

    com.nokia.memoryramfree

    is encouraged for more accurate info.

    More on the issue:

    http://wiki.forum.nokia.com/index.ph...ory_in_Java_ME

    Regards,
    r2j7
    [URL="http://library.forum.nokia.com/java"][B] >>> Java Developer's Library <<<[/B][/URL]
    [URL="https://www.developer.nokia.com/Resources/Support/Technical_support.xhtml"] [B]>>> Technical Support for Java ME development <<<[/B][/URL]
    [URL="https://publish.ovi.com/info/"][B]>>> Nokia Publish: reach millions of Nokia users worldwide through Nokia Store <<<[/B][/URL]

  5. #5
    Registered User
    Join Date
    Jan 2008
    Posts
    37

    Re: Memory Available to JVM is too small...

    Well, Thankx r2j7 !


    I have studied the link prvided by you,


    But the problem is still there,............
    Although, it is transfering the 200KB on emulator...

    Why in my case Heap Memory is not increasing ????
    Huzefa

  6. #6
    Registered User
    Join Date
    Mar 2008
    Posts
    3

    Re: Memory Available to JVM is too small...

    From what I see there are 3 kinds of memory the total ram, the available (total minus other applications), and the memory that the JVM allocates for you're application(at any given time) so determining the memory is a fools game IMHO.

Similar Threads

  1. Why createImage(x, y) takes so small memory?
    By Creator3D in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2005-03-22, 16:07
  2. Memory allocation in JVM
    By andypro in forum Mobile Java General
    Replies: 0
    Last Post: 2004-09-27, 08:08
  3. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29
  4. Replies: 2
    Last Post: 2002-06-26, 08:57
  5. 9210 and 9210i java memory
    By allams in forum Mobile Java General
    Replies: 0
    Last Post: 1970-01-01, 02:00

Posting Permissions

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