×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jan 2004
    Posts
    1

    problems with app on Nokia 6600

    I'am developing a midp-application (Version 2). The application starts on the device, but if I press a button in my application an error occurs: "Progr. geschl. jes-453-javax.microedition.lcdui1@1..."
    I assume that "Progr. geschl." is the german translation of "program closed" and it is an error of the java-display-class....perhaps it is an error with the heap-memory - because my application needs many memory. With the emulator of the J2ME Wireless Toolkit by SUN I have no problems - but on the device I get errors. If I reduce the heap size under ~150 kb I get an java.lang.OutOfMemoryError......
    I`ve read some articles about reducing the needed heap memory amount....but it did not realy solve the problems /helped....saving all items in the record-store does not solve the problems, too...
    How many heap memory is available on the Nokia 6600? Any suggestions?Does exist a bug-list for the-java-implementation on series 60 devices?

  2. #2
    Registered User
    Join Date
    Nov 2003
    Posts
    37
    Hi,

    I'm facing the same problem with you, and I believe many developer also face the same problem.

    The heap memory available on 6600 is 3MB, from Nokia website. And about the app closed error, from my experiance, it will happen (randomly) when we try to allocate new UI item, by using "new" operator, eg,

    myDisplayble dis = new myDisplayble();

    I solve this problem by "new" all Displable in my application as static global variable. and the result is.. I get no more the "App Close jes-xxx-javax.microedition.lcdui..." : )

    But this method take a lots of heap memory at the starting time. the the result is.... I create a splash screen :P

    I still under testing of this method, some time when the line
    list.append("item", null);
    also will generate that error... try not to use append() too much..

    Anybody have any better solutions for this, please advice..

    Cheers...

    If anybody

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    24
    (sorry for english)
    I too get this error on 6600!

    "App Close jes-xxx-javax.microedition.lcdui..."

    I put all variables in static global mode, but the error pop up randomly...

    I read this article:
    http://www.microjava.com/articles/techtalk/recycle

    Pheraps is the fragmentation of Heap Size the cause of error?

    Have you some new hints?
    Thanks

  4. #4
    Registered User
    Join Date
    Nov 2003
    Posts
    37
    Let check it, even you put all variable as global static, you cannot create a new object to it when you need it.

    Your code should bo something like this :

    class Midlet1 {
    public static MyForm myForm;

    public Midlet1() {
    myForm = new MyForm();
    ....
    ....
    }

    public void commandAction(Command command, Item item) {
    if(command.getCommandType == Command.OK) {
    // call the myInit() method to re-initilise your form, instead create a new object
    myForm.myInit();
    Display.getDisplay(this).setCurrent(myForm);
    }
    }
    ....
    ....
    }

    Just "new" the myForm Displayble ONCE time in your midlet(in the midlet's constructor). If you "new" more then 1 time on your midlet, then you will get the random error msg.

    Try it out and see, share with me the result ..

    Yes.. I guess the problem is couse by some memory issue ... may be coz by the VM's bugs...

    Cheers..

  5. #5
    Registered User
    Join Date
    Oct 2003
    Posts
    24
    My problem is that 6600 isn't mine, and im to wait about 2 weeks before i can test again with it.

    As i can i'll show you my results:

    I did static variables in this way.
    I did all the new in this way:

    -----------------
    v.java:
    ******
    public class v {

    static Display display; // Reference to Display object
    static Command okList = new Command("Ok", Command.OK, 1);
    static Command indietro = new Command("Indietro", Command.CANCEL, 2);
    static TextBox grammi0 = null;
    static TextBox cerca0 = new TextBox("Secondo Alimento", "", 100, TextField.ANY);
    static List listabreve = null;
    static List risCerca0 = new List ("Risultato Ricerca",List.IMPLICIT);
    static Form risultato = new Form("Risultato");
    static Form dettaglio = new Form("Dettagli");
    static ImageItem imm1 = new ImageItem("", null,ImageItem.LAYOUT_CENTER, "");
    static ImageItem imm2 = new ImageItem("", null,ImageItem.LAYOUT_CENTER, "");
    static Vector risali = new Vector();
    static Vector riscalo = new Vector();
    ..
    }

    -------------


    ------------------------------------
    scelta0.java
    **********

    public class scelta0 extends TextBox implements CommandListener {

    private Command risultato = new Command("Ris", Command.CANCEL, 2);

    public scelta0() {
    super("First:", "", 100, TextField.ANY);
    this.addCommand(v.cerca0conferma);
    this.addCommand(v.cerca0back);
    this.addCommand(risultato);
    this.setCommandListener(this);
    }

    public void commandAction(Command c, Displayable d) {

    ...
    ...
    ...
    if (c==v.cerca0conferma)
    {
    this.setTitle("...Wait Please...");

    v.risCerca0.setTitle("Risults");

    // Update v.risali vector
    v.uty.find(this.getString());

    if (!v.risali.isEmpty())
    {
    v.risali.firstElement();
    for (int i = 0; i < v.risali.size(); i++) {
    v.risCerca0.append(v.risali.elementAt(i).toString(), null);
    }

    v.risCerca0.addCommand(v.scelto0ris);
    this.setString("");
    this.setTitle("Next Alim:");
    v.risCerca0.addCommand(v.scelto0back);
    v.risCerca0.setCommandListener(this);
    v.display.setCurrent(v.risCerca0);
    }
    ..
    }
    ----------------------------------------------
    In this way i do new object only in v.java, and after i reuse the objects without any new.

  6. #6
    Registered User
    Join Date
    Nov 2003
    Posts
    37
    matteopiccioni, you mean you have solve this problem with that way?

  7. #7
    Registered User
    Join Date
    Oct 2003
    Posts
    24
    no i didnt solve the problem yet..
    i was only show how is written my code.

    Next week i'll begin to try to a real 6600

    (for now i cant test any fix on my code)

    hi

Posting Permissions

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