You Are Here:

Community: Developer Discussion Boards

#1 Old RecordStore doesn't seem to free in mem - 2004-05-28, 14:14

Join Date: Mar 2003
Posts: 82
FatalError
Offline
Regular Contributor
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
Reply With Quote

#2 Old 2004-09-28, 00:23

Join Date: Mar 2004
Posts: 8
Spider@Nokia
Offline
Registered User
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
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

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

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia