Memory leaks, methods and tools to find?

Silentsea

Member
Licensed User
Longtime User
Hi,

after a long break of development I could now finish a first version of our b4a android app. Thanks for this wonderful framework. Testing the software I noticed some stability problems (not b4a part I think). I found some unexpected bugs. The app is loosing memory. First I thought a part of my picture drawing code was wrong but after breaking down parts of the software I noticed this behaviour in other parts too. Reading across some threads in this forum, I detected some posts in context of setting references to null, or using objects only local and recycle bitmaps etc.. I thought I do this most times, especially using objects local. But maybe I was misunderstanding some parts.

So here are some questions of mine:
  • Finishing activities: All references should be cleared, if a view belongs to this activity, and a object to this view?
  • Scrollview rebuilding: In some cases I have to rebuild a scrollviews whole structure, first I delete all views belonging to this global activitiy view. But what about the objects in this views beloning to this view before?
  • What tools can I us to detect my mem problem, in java forums I've read to use eclipse tools to detect my still referenced objects?
  • Other methods or tools you prefer, next writing clean code ;)?

I have to say, because of our design, I use a lot of images, all the bitmaps are initialized at startup (size will be upscaled, so I try to use little images). After then in activity create, I use setbackground to refer to this image.

Thanks in advance.
Silentsea
 
Top