Read-only archive of the All About Symbian forum (2001–2013) · About this archive

6680 Memory Problems -- URGENT!!!!

0 replies · 2,236 views · Started 17 October 2005

Hello.
I am reading a file that is 116KB, sometimes the files are up to 500kb, using jsr75 i read it all into memory using;


FileConnection fc = null;
java.io.DataInputStream dis = null;
try {
fc = (FileConnection)Connector.open(sTempPathname);
bData = new byte[(int)fc.fileSize()];
dis = fc.openDataInputStream();
dis.readFully(bData);
}
catch(OutOfMemoryError oome)
{
error = oome;
bData = null;
}
catch(Exception e){
// error
error = e;
bData = null;
}

Then, I create an array of ints as int[1280*8] and then I create another array of int[170*200]. i do some processing and free the arrays. Then the application appears to crash when I try to read another file from file system. I press the Menu button to get back to main menu screen. then try to open TaskBar to kill app and I get Memory Full. I don't understand what is wrong, I freed all the buffers so why am I getting Memory Full errors?

I don't appear to get the errors on 6630. Is there something wrong with 6680? I printed out free memory before allocation and it says 49,000 and I print it after System.gc() and Runtime.freeMemory() reports 412000 which is weird!

I ran Runtime.totalMemory() and 6630 and 6680 reported having same amount of memory 512000.

The midlet size is 273Kb.

Please Help!!!!