The best way to avoid heap memory problems is by using the variable declaration with appropriate scope. The usage of having global variable should be reduced as much as possible. and keeping unused memery block without clearing it. In game programming the main issue is having an image in memory. Only those images which definitly has to be in the memory and the other have to be cleared regularly.
I think there is the finalize() method, which will call often whenever the varriable is not in use, and make the memory free. Is this finalize method supported in either CLDC 1.0 or CLDC 1.1