×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Carbage collection && quitting from app

    Hi!

    I have done an app. I´m asking how can I quit from this app:

    public class RecordMidlet extends MIDlet {
    public void startApp() {
    Display.getDisplay(this).setCurrent(new RecordForm());
    }

    public void pauseApp() {
    }

    public void destroyApp(boolean unconditional) {
    notifyDestroyed();
    }
    }


    The recordform implements all the functionality etc. :
    else if(comm == exitCommand) {
    }
    What do I write when the exit button is pressed? I´ll have to call the notifydestroyed method etc? But How? The upper code part is from the form class.


    The other question is carbage collection? I call couple times in the Form -class System.gc() -method, but I think it doesn´t collect carbages and the app hangs because the lack of memory.

    I think right way is to call the System.gc() -method in my Midlet -class (RecordMidlet), but how?

    The RecordForm -class records video and sends some data to the server. after 10 video recording and sending some data to the server it hangs, because the lack of memory.

    I set all the arrays etc. used to null, and call the System.gc() -method, but it won´t work.

    Any hints or ideas anyone? The phone I´m using is Nokia 6630.

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Re: Carbage collection && quitting from app

    Now the exiting from app works. Here was an good example: http://forum.java.sun.com/thread.jsp...sageID=4056234

    Still the Carbage collection doesn´t work.

  3. #3
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Re: Carbage collection && quitting from app

    Now the carbage collection works! I did have to put some waiting time with midlet.wait()-method. It works too good, because in my app is an loop, and the loop breaks after system.gc() -method. The loop is meant to continue forever.

  4. #4
    Registered User
    Join Date
    Mar 2004
    Posts
    13

    Re: Carbage collection && quitting from app

    In my app is an for() -loop:


    for(; {
    ...Some other code...
    System.gc();
    Midlet.wait(300);
    }


    The for loop breaks when the System.gc is called.

Similar Threads

  1. How to make sure the inside app just can be executed on one place
    By cellsoft_David in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-06-15, 09:52
  2. App crash problem - how to figure out why?
    By neomedia in forum Symbian
    Replies: 1
    Last Post: 2005-02-07, 16:22
  3. Dialog's clipping area (again). Nokia experts, please help
    By synov in forum Symbian User Interface
    Replies: 0
    Last Post: 2004-06-26, 14:35
  4. 7650 - go back, close my app not closing the container app
    By geran in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-12-05, 10:00
  5. Launching an app from pJava..
    By krajag in forum PersonalJava
    Replies: 0
    Last Post: 2002-10-10, 19:57

Posting Permissions

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