Problem of memory fragmentation. | developer.brewmp.com Problem of memory fragmentation. | developer.brewmp.com

Developer

Problem of memory fragmentation.

Forums:

Hi,

In my game on Nokia 6225i evey time I play the game and end it and again start it, free meory size goes low each time. Even I free all the pointer and there is no memory leak.

Also when I play the game 5th time the free memory size goes to 20K which is not sufficient for loading images and other data.

I think there is some memory fragmentation issue on nokia 6225, because if game works fine first time it should be do the same thing each time.

Can any body bring some light on this topic..
and give some solution of it.

waiting for help and suggestion..........

I have written and released a number of games on that particular handset and there are no overt memory fragmentation issues really.
In your case I would rather suspect that maybe you are not properly destroying a BREW object. When you create an object like, say IBITMAP, you have to make sure to call the respective Release() function to free up all memory it may have been using. Sadly the BREW docs do not point out which objects require you to explicitely release them so you will have to investigate and check for each of the API objects you're using to see if a corresponding Release() function exists and then make sure to call it before you destruct the object.

I have written and released a number of games on that particular handset and there are no overt memory fragmentation issues really.
In your case I would rather suspect that maybe you are not properly destroying a BREW object. When you create an object like, say IBITMAP, you have to make sure to call the respective Release() function to free up all memory it may have been using. Sadly the BREW docs do not point out which objects require you to explicitely release them so you will have to investigate and check for each of the API objects you're using to see if a corresponding Release() function exists and then make sure to call it before you destruct the object.