×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Out-of-Memory Error

    Hi guys,
    I develop an App. that gets GPS data and send them to a valid IP address(by tcp connection).

    I have one form for user registering..then App. try to get gps data,and save them in a file if there is no gprs.and if gprs is active,send data to an IP address.
    also I have a user interface that shows gps data to user,and status of gps and gprs...
    everything is well,location update method was called every 15sec(my interval)...I set a variable that counts the number of call this method,when this variable is 130 or another time,320,then this message appear::"Application will be close."and when going to detail,it says "out of memory error"...
    I try to close any forms that used in previous steps of running App. that help me for reuse memory,but still this error appears.
    I try this App. on N78 and E52.
    in E52 I install it on memory card that has 450MB free(in this situation error was appear after 90~130).and try it on phone memory with 50MB free(in this situation error was appear after 130~320).
    is there any idea??

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

    Re: Out-of-Memory Error

    OK, first, the amount of space on the memory card has nothing to do with "OutOfMemory". The memory card is used for storing files, not for executing programs. Think of it as "hard disk" rather than "RAM". It's "RAM" you're running out of. There is memory that is used for executing programs, and is shared between all programs currently executing, and it is this memory you're running out of.

    Next, the recommended practice for using the Location API is not to call Location.getLocation(). Instead, create a class that implements the LocationListener interface, and use Location.setLocationListener() to request location updates.

    Are you able to reproduce this problem in the emulator?

    Graham.

  3. #3
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Re: Out-of-Memory Error

    Hi
    thanks for reply.
    I use Location.setLocationListener() method.
    this error doesn't occur in emulator..
    I try another time with interval 10 sec,this time my app call location update method for 1200 times and then this error appear::Application was closed.(out of memory)

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

    Re: Out-of-Memory Error

    What happens if you don't send the location to the server (and don't even connect to the server)? We need to find out which part of the process is consuming all the memory.

    Graham.

  5. #5
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Re: Out-of-Memory Error

    Maybe I get you wrong...
    my App. design is sendding mobile location data in some time intervals to server,I need to do it.

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

    Re: Out-of-Memory Error

    Which part of your application is using all the memory? Do you know? Do you lose memory when you get the location, or when you upload it to the server?

  7. #7
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Re: Out-of-Memory Error

    NO,I get location data well,and I send it to server also very well,but these steps when repeated for 100 times or more,this error appear:Application will be closed.(unhandled Exception)....So I don't know which part of my app arise this problem?????

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

    Re: Out-of-Memory Error

    OK. So, my suggestion is, remove the part of the code that sends the location to the server. If you still get the problem, you'll know it relates to getting the location. If you don't get the problem anymore, you'll no it relates to sending the data. A process of elimination.

    Graham.

  9. #9
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Out-of-Memory Error

    Also have you tried running the same app on the WTK emulator ? And then looking at the memory usage using the Memory Monitor ? At least there you can see which types of Objects cause the (ever?) increasing memory usage...

  10. #10
    Regular Contributor
    Join Date
    Aug 2009
    Posts
    63

    Re: Out-of-Memory Error

    Hi
    I test my App with memory monitor::

    objects from memory monitor that use very much memory.


    java.lang.string[]
    +17.57% java.lang.class.runcustomcode()

    +71.18% com.sun.midp.lcdui.defaulteventhandler$queuedeventhandler.run()
    +com.sun.lvem.location.kvemportinglayer.getlocation()
    com.sun.lvem.location.kvemportinglayer.parse(Ljava.lang.string;,Ljava.lang.string

    +5.18% com.sun.kvem.location.locationproviderimpl.run()

    char[]
    +52.48%com.sun.midp.rms.recordstorefile.initsecuritytoken(Lcom.sun.midp.security.securityToken
    +4.4%com.sun.midp.lcdui.systemEventDispatcher.getEventData()
    +11.01% java.lang.floatingDecimal.readJavaFormatString()

    java.lang.string
    +42.66% java.lang.string.substring(I,I)
    +8.53% com.sun.midp.lcdui.systemEventDispatcher.getEventData()

    int[]
    +88.82% java.lang.FloatingDecimal.doubleValue()

    java.lang.FloatingDecimal
    +59.88% java.lang.FloatingDecimal.readJavaFormatString(Ljava.lang.string
    +23.95% java.Lang.Double.parseDouble(Ljava.Lang.String

    java.Lang.FDBigInt
    +93.83% java.Lang.Double.parseDouble(Ljava.Lang.String

    is these information,could help??

  11. #11
    Super Contributor
    Join Date
    Apr 2007
    Posts
    2,708

    Re: Out-of-Memory Error

    hhmm, yeah well if I were you I would look at those stats over time, and see which ones actually keep increasing and finally might cause the excpetion...
    Just posting those stats here wont help because I have no idea which ones are the ones who keep increasing...
    So you will have to look at those over time...

Similar Threads

  1. [newbie here] Link error
    By xitpu in forum Symbian
    Replies: 3
    Last Post: 2007-01-24, 16:53
  2. carbide build problem help please
    By berkcekisbas in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2006-09-26, 19:41
  3. problem with Code Warrior 5.2
    By mayankkedia in forum Symbian
    Replies: 4
    Last Post: 2006-06-22, 08:26
  4. problem with codewarrior 5.2
    By mayankkedia in forum Symbian Tools & SDKs
    Replies: 3
    Last Post: 2004-09-27, 16:08
  5. camera app compilation problems
    By basarim in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2003-12-31, 18:16

Posting Permissions

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