×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Which one is right in Nokia's document?

    Hi All,

    Here,http://www.forum.nokia.com/devices/E51
    It says the Maximum Heap Size is Unlimited,but in the Nokia's another document "JavaTM ME Developer's Library 2.3.
    It says below:
    The Java heap is reserved from host OS memory. The amount of free RAM varies between devices, it’s typically between 15 – 25 MB. Java heap is grown and shrank dynamically and it can grow up to 16 MB.
    Above comments are from here: http://www.forum.nokia.com/document/...545284B0F.html.

    And I had tested it in S60 3rd FP1 emulator. The maximum heap size was 16MB when the "outOfMemoryError" was thrown every time.

    Do you know why/reason?

    Thanks,

    With best regards.

  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Which one is right in Nokia's document?

    Whereas most devices allocate a fixed amount of memory to the Java runtime, Series 60s allocate memory as required by the Java application. "Unlimited", because there is no fixed limit.

    Of course, the amount of physical memory is limited. The operating system cannot provide the Java runtime with more memory than exists on the device.

    The actual maximum will depend on:

    * How much physical memory the device has.

    * How much memory is being used by other applications running on the device.

    If the browser and media player are running, for example, there will be less memory to provide to the Java runtime. The device will attempt to provide the amount of memory your application wants, but there are no guarantees.

    Usually, emulators allow you to configure the amount of memory they will provide. For the WTK 2.5.2 emulator, you do this like:

    Code:
    emulator -Xheapsize:16M -Xdescriptor:myapp.jad
    I don't know the options for the emulator you're using. Check the documentation.

    Cheers,
    Graham.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Which one is right in Nokia's document?

    Hi grahamhughes,
    Thanks for your reply.
    I agree with you.

    But, I had done a test at before. I tried setting the memory of emulator as 100MB,but the "outOfMemoryError" was still thrown, and the free memory was almost 80MB at that time.

  4. #4
    Super Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    9,560

    Re: Which one is right in Nokia's document?

    Note that the emulator does not behave exactly as actual devices. You need to test on the real devices (different models, based on different S40 and S60 versions) to know how your software behaves in real life.

  5. #5
    Super Contributor
    Join Date
    Jun 2003
    Location
    Cheshire, UK
    Posts
    7,395

    Re: Which one is right in Nokia's document?

    petrib's right... and test on different models, as no two models behave quite the same, especially when you're pushing devices to their limits.

    To assess what's causing your problem, we'd need to know what's throwing the exception. Note that Series 60s handle some objects (like Images and some 3D graphic objects) outside the Java heap. This can make Runtime.freeMemory() a poor indicator of what you can allocate.

    Cheers,
    Graham.

  6. #6
    Registered User
    Join Date
    Sep 2008
    Posts
    8

    Re: Which one is right in Nokia's document?

    Hi petrib and grahamhughes,

    Thank you!
    I will try to test it on different real devices.

    FYI, on S60 3rd FP1 emulator, the exception thrown is below.

    java.lang.OutOfMemoryError
    (stack trace incomplete)

Similar Threads

  1. Replies: 21
    Last Post: 2009-04-18, 12:00
  2. Replies: 2
    Last Post: 2007-03-14, 17:15
  3. Best way to lanch an document
    By fjorge_ht in forum Symbian
    Replies: 0
    Last Post: 2006-03-09, 18:50
  4. Replies: 1
    Last Post: 2005-05-26, 14:22
  5. Recognition and strange document name
    By space2 in forum Symbian
    Replies: 0
    Last Post: 2003-12-10, 10:28

Posting Permissions

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