×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Mar 2003
    Posts
    82

    RecordStore doesn't seem to free in mem

    Hi,

    I just remarked something, in my game I'm open and close a recordstore just like this
    try
    {
    RecordStore r = RecordStore.openRecordStore(name,true);
    r.closeRecordStore();
    r=null;
    System.gc();
    }

    If I watch the free heap mem in the status window of the s40 emulator I see a difference of about 8k between the higher free mem value if I do the above code and the higher free mem value if I do not execute it...

    How can this be ? Why does the mem not released ?

    thanks

  2. #2
    Registered User
    Join Date
    Mar 2004
    Posts
    8
    same problem here,

    my Code:

    public static void loadRecordStore()
    {
    ByteArrayInputStream is = null;
    DataInputStream ds = null;
    RecordStore rs = null;

    try
    {
    rs = RecordStore.openRecordStore("OPTIONS", false);
    byte[] buff = rs.getRecord(1);
    is = new ByteArrayInputStream(buff);
    ds = new DataInputStream(is);
    try {
    // read int and boolean
    } catch(IOException e) {
    System.out.println("Error occured in loadRecordStore: " + e);
    }
    } catch(RecordStoreException e) {
    System.out.println("RecordSet doesn't exist in loadRecordStore: " + e);
    } finally {
    try {
    if(is!=null)
    is.close();
    if(ds!=null)
    ds.close();
    if(rs!=null)
    rs.closeRecordStore();
    } catch(Exception e) {
    System.out.println("Error occured in loadRecordStore: " + e);
    }
    }
    }

    openRecordStore takes 5k heap, still after this function.

    Greetings,

    S. Schmid

Posting Permissions

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