×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Oct 2005
    Posts
    55

    How to Free Heap Memory In 9500?

    Hi! My application is creating image in canvas continuously after every download from the http connection. The problem I'm facing right now is after running my application for a while, the whole device will hang. Is it due the the unfreed memory space when continuously creating the images? I tried to use Runtime.getRuntime().freeMemory(); but still fail to free up the heap memory? Could anyone help me?


    Thanks in advance!

  2. #2
    Registered User
    Join Date
    Oct 2005
    Posts
    47

    Re: How to Free Heap Memory In 9500?

    Hi

    You need to free up the memory immediately after using it in the function/procedure.

    You can use simple 'delete' for heap allocation.

    I don't know what method you are using for opening an image and pasting it to canvas. Try to use same pointer for all the images. Just set properties for pointer.

    Hope this is helpful

    Thanks & Regards
    Niilesh.

  3. #3
    Registered User
    Join Date
    Oct 2005
    Posts
    55

    Re: How to Free Heap Memory In 9500?

    Thanks for your reply, Niilesh. I know only 2 method to free memory which are System.gc() and Runtime.getRuntime().freeMemory(). How to delete the heap memory like you said? What command should I put?

  4. #4
    Regular Contributor
    Join Date
    Jul 2005
    Posts
    79

    Re: How to Free Heap Memory In 9500?

    I think niilesh is talking about different technology C++, while jaceline is working with J2ME.

    Jaceline, as we know jvm in java automatically cleans out Garbage.
    Though you can only request to jvm for Garbage collection using System.gc().
    But it is not sure - the Garbage is collected. right.

    I will suggest you - the best approach is whatever object are being used for displaying image - when going back - make those object as NULL.

    regards - amin

  5. #5
    Super Contributor
    Join Date
    Dec 2005
    Location
    Europe/Poland/Warsaw
    Posts
    1,697

    Re: How to Free Heap Memory In 9500?

    hi,
    just to add:
    make those object as NULL
    all references to that object,

    regards,
    Peter

Similar Threads

  1. Question. Free memory in Game Loop(J2ME)
    By videador in forum Mobile Java General
    Replies: 5
    Last Post: 2009-08-24, 06:05
  2. Replies: 8
    Last Post: 2004-04-02, 13:36
  3. Nokia Comunicator 9500
    By alvisone in forum General Development Questions
    Replies: 2
    Last Post: 2004-03-01, 07:01
  4. Free RAM and Free User Memory
    By koayst in forum Symbian
    Replies: 5
    Last Post: 2003-05-09, 12:47
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

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