Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 84
Registered: ‎09-21-2008
My Device: Not Specified

Memory Issues?

 

We have been having a heck of a time tracking down what we can only describe as a memory leak. We have seen it on multiple physical devices where when our application is running, it runs down the memory on the device to 0. However, when we run on any simulator (some matching the device OS versions of physical devices) we have not been able to reproduce it.

 

Does anyone have an suggestions on how to best analyze what is happening when runnning on a physical device.

 

We already have run through the the standard profiling process of breaking, snapshot, running, breaking then comparing to snapshot, but when running on the simulator we have not seen anything out of the ordinary.

 

When running on the device, the debugging ability is much more limited to the point that it is hard to track down what is happening on the device..

 

Anybody have any suggestions on how to track down a memory issue on a device when we cant reproduce it in a simulator?

 

 

 

 

Developer
Posts: 141
Registered: ‎02-10-2010
My Device: 9500
My Carrier: Airtel

Re: Memory Issues?

Some check points that might be of use:

1. Use profiler & log the profiling statistics to event log.

2. Track all the major container objects of your application and log the memory statistics for them when any object gets removed/added. May be the object once allocated are not getting released. In case you want to store the objects for long time, you should choose to use persistent store/rms/file/DB.

3. Clear the contents of all containers after their work is over.

Highlighted
Developer
Posts: 1,415
Registered: ‎07-30-2008
My Device: Not Specified

Re: Memory Issues?

what all are you doing? Do you have suspects?

Someone reported an issue with a possible leak in httpconnection, I've seen recent thread updates but haven't looked. Tracking containers ( hashes and vectors or things you keep track of so you remember to delete LOL) are good suspects if they don't use weak refs. Listeners sometimes come up and anything called  close(), release() or dispose() etc may be getting called on sim but not on device due to timing or usage issues.