Hi everyone,
I try to develop a graphic application. After I load some PNG, I've got a memory leak everytime when I call repaint() method.
Any idea?
Thanks.
Hi everyone,
I try to develop a graphic application. After I load some PNG, I've got a memory leak everytime when I call repaint() method.
Any idea?
Thanks.
did you set those image objects that never used again to null?
Yes, I did.
But the Memory Leak is only happen when I call the Repaint() function.
Any idea? Thanks.
Kit
I am not sure about your problem. But maybe you can try to use gc(). In my program, memory useage continue to increase. But after I use gc() a lot of memroy been released. Even I don't use gc() manually, system automatically call it when free memory used out. By the way, review your program to ensure that there is no any object that never used again but still in reference. Such objects isn't collected by gc and may cause memory leak.
Hope it helps.
Last edited by bitsonic; 2003-04-08 at 16:01.
I encounter the same problem.
Even the Nokia Blockgame heap memory is growing in the emulator status all the time.
When it's full it seem to reset to zero and start all over again.
-Peter
pvermeulen: Would it be the SDK bug??
bitsonic: I did your approach. It can resolve my problem but it that gc() should occur everytime when I call object = null???
Thanks,
Kit
Acutally, system may not immedially call gc() after you set objects to null. Unless you manually call gc(). To my knowledge, only when there is not enough memory would the system call gc() to collect those unused objects and to release memory. That is why someone saw memory usage increasing and then reduce suddenly.
I don't know if it's an SDK bug (3510i sdk) ?
I'm new to J2ME programming (I actually only started this week) ; but my game should be finished next week and not being able to check for memory leakes is quite annoying.
If anyone else that is using the 3510i sdk encounters the same problem please post here..
Thx,
-Peter