I don't know if the topic is "J2ME in the memory leak", but in J2ME, if the creation of bad resources is handled, there will be a memory leak in C / C . The most commonly used resources in J2ME is nothing more than pictures and sounds. In order to improve the running speed of the game, we usually declare them as global variables, and we cannot load these resources simultaneously into memory due to the relationship between mobile phone, so we will import resources (create objects) when using it. Temporarily unwanted resources (picture or sound) object assignment to null (of course this is my practice, don't know if you are the same as everyone). If the processing is not good during this period, there will be some resource objects that have not been cleaned in the memory, which will cause memory leaks, and the result is that the memory is getting smaller and smaller. I will explain it below. 1. Picture resource points: To declare an object variable for each image resource assumptions 2 pictures objects in a program: image pic1, pic2; if you want to use PIC1 and PIC2 at a certain time: if (PIC1 == Null Pic1 = image.createImage ("/ 1.png"); if (pic2 == null) PIC2 = image.createImage ("/ 2.png"); after these images are used up, it should be: pic1 = null; Pic2 = NULL; if you need to use two other pictures 3.png and 4.png, the two variable objects PIC3, PIC4 are best to import them, do not use PIC1, PIC2 variables to import these two pictures, such as: IF (PIC1 == NULL) PIC1 = image.createImage ("/ 3.png"); // Don't do what IF (PIC2 == NULL) PIC2 = image.createImage ("/ 4.png"); // Don't This will do this because this will affect the recovery of the garbage collector to PIC1 and PIC2 objects, resulting in memory recovery. 2. Sound resource (different platforms are different) points: like the image resources, in addition to the recycling sound resource must stop the playback of the sound; and before you start playing the sound, you must first judge the sound first. Status (simple point, call STOP directly, let the sound stop, then play again), if you do not stop the play, call it to run playback, you may generate an object that cannot be recycled (this is my guess) Memory leakage. Such as: Suppose Sound is released for sound objects: if (sound! = Null) {Sound.stop (); Sound = NULL;} Sound of Sound resources can be safely retracted by the garbage resource: IF Sound! = null) {sound.stop (); Sound.Start ();} The above is my experience, maybe there is a wrong place, please forgive. Thank you