Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Dec 2008

    Increasing the heap size

    Dear all,
    I am in great problem. My j2me application is showing me "OutOfMemoryError". I've known that I should increase the heap size of my midp application instead of netbeans IDE (I am using Netbeans IDE 6.1). For increasing Netbeans heap size we should modify the "netbeans.conf" file at etc directory. But how to change the application(project) heap size. If it is a j2se project then I have an option to change heap by going to "Properties"----->"Run"----->"VM Options". But for a mobility midp application I am finding no such thing.

    So, I wanna increase heap size of my midp application. How can I do it? Help me plz. It is very very much emergency for me.

    Or suggest me if increasing the heap size of netbeans will work, how do I configure it?

    Thanks in advance.


  2. #2
    Super Contributor
    Join Date
    Jun 2003
    Cheshire, UK

    Re: Increasing the heap size

    You can adjust the heap size for the emulator. This is configured in the emulator settings, or from the command line used to execute the emulator. Check the emulator (or WTK / SDK) documentation for this.

    However, you cannot adjust the heap size on the device. Some devices (Series 40, for example) use a fixed size heap, which will never change. Other devices (Series 60) use a dynamic heap, which will expand automatically if the application needs more memory (there will, of course, still be a limit of how much memory the device can provide to the JVM).

    If you increase the memory on the emulator, you may simply have the same problem when you try the app on a device. It may be better to reduce the amount of memory your application requires.


  3. #3
    Super Contributor
    Join Date
    Mar 2008
    The Capital of INDIA

    Smile Re: Increasing the heap size

    I would recommend that do not try to implement the temporary solution like increasing the capacity of heap the emulator or so.Please just try to find the root reason of the issue of out of memory.Please do check that why it is coming?
    1.What you are loading in the game?
    2.Images and the any other resources size is also,a critical reason.
    3.How you are painting the canvas/gamecanvas?
    4.Please do check that you are not loading the images and other resources,objects in a loop.
    5.You are reading the file from resource in a loop,
    Thanks with Regards,

    R a j - The K e r n e l

    Join Delhi-NCR Nokia Developer's Community,

  4. #4
    Regular Contributor
    Join Date
    Jun 2008

    Thumbs up Re: Increasing the heap size


    Grahamhughe is correct that You can adjust the heap size for the emulator but If you increase the memory on the emulator,you will get same problem when you try application on device So please try to reduce the heap by application.

    If you are using series 40 sdk then you can increase heap by follow this steps
    1. open tool of emulator
    2. preferences
    3. MIDP

    Then you can find the option Set KVM Heap size and increase the heap size.


Similar Threads

  1. Increasing Heap size
    By earamsey in forum Mobile Java General
    Replies: 3
    Last Post: 2007-10-18, 17:58
  2. 3rd ed emulator heap size
    By apsaarin in forum Symbian Tools & SDKs
    Replies: 7
    Last Post: 2007-03-15, 02:29
  3. Audio Input Stream on N80
    By tkaihock in forum Symbian Media (Closed)
    Replies: 9
    Last Post: 2006-06-30, 09:15
  4. info about heap size
    By gmatkar in forum Mobile Java General
    Replies: 5
    Last Post: 2006-03-10, 04:05
  5. increasing kvm's heap size
    By vickychhabra in forum Mobile Java General
    Replies: 1
    Last Post: 2003-04-17, 16:33

Posting Permissions

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