×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2005
    Location
    Israel
    Posts
    2

    Nokia 6630 OutOfMemory problem

    Hello guys,
    I am having OutOfMemory error on my application on the Nokia 6630. Stress that this happens very frequently or always on the 6630. The application works fine on 6600... The application is sending http request to the server each 10 sec. I checked free memory ( Runtime.getRuntime().freeMemory() ) . Free memory is declining and after 10 minutes I have OutOfMemory Exception or device is freezing.

    Can anybody tell me it is possible to solve the problems?

    Regards,
    Helena.

  2. #2
    Super Contributor
    Join Date
    Nov 2003
    Location
    Bangalore , India
    Posts
    4,429
    Hi Helena! Welcome to Nokia Discussion Boards !!

    Have you tried using System.gc() ??

    I dont know whether this could help you ; but just give a try!

    regards
    Gopal

  3. #3
    Registered User
    Join Date
    Jun 2005
    Location
    Israel
    Posts
    2
    It doesn't help .... (
    Do you have any other ideas how to solve this issue?

    Thanks.
    Helena.

  4. #4
    Registered User
    Join Date
    Dec 2004
    Location
    Liverpool, United Kingdom
    Posts
    16
    Hi Helena,

    Without seeing your code it is difficult to suggest what the cause might be, you may want to consider posting the relevant sections of your code.

    Verify on the 6630 that all aspects of the HTTP connection establishment are occurring. You want to ensure that the connection is being setup and torn down correctly and that the 6630 is not locked because a high-priority network thread is blocking whilst it waits for a reply back from a remote server.

    If you are establishing the connection via a command listener (i.e a click on a menu option) then remember that you must dispatch the connection setup on a separate thread other wise you *will* lock up the UI at some point. This is a very common error. Do not setup network connections on the UI thread, it will lock up the device.

    On the memory side, here's one idea: are you building strings using the string concatenation operator "+"? The memory requried for these strings quickly builds up. If so, you may need to switch to building your strings in a character array, or ensure that a System.gc() is called as soon as the strings have been used.

    The other possibility, is that the connection is not being cleaned up correctly before the next connection is established. Are you sure that the connections are being closed before you attempt another? E.g:
    try{

    // network connection

    }catch(IOException ioe} {
    // handle it
    }finally {
    // make sure streams and connection is closed.
    try{
    in.close();
    }catch(Throwable t){}
    try{
    out.close();
    }catch(Throwable t){}
    try{
    connection.close();
    }catch(Throwable t){}
    }


    Note that the OutOfMemory errors and the freezing could be symptoms of the same problem, or two different problems in your code.

    Hope that helps.

    --Mario
    Last edited by mgianota; 2005-06-30 at 12:10.

  5. #5
    Regular Contributor
    Join Date
    Sep 2004
    Location
    Barcelona, Spain
    Posts
    68
    Hi, I'm developing an application for nokia 6630 that connects each 5 seconds with httpconnection and I have no problems, if you can show us your code maybe we can help you.

    Hope it helps,
    Nuria.

Posting Permissions

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