01-10-2014 01:45 PM
I'm trying to use this tool to detect memory leaks on the app but without success.
If I run the app in Debug mode using a configuration with the Memory Analysis Tool enabled the app is breaked at _start_() symbol as usual and the screen is black. However if I press the green triangle (Resume) the app is just closed or maybe it crashes, I can't know that.
I also tried to run the app manually from the phone and then from the PC I have started a "Attaching to Running App" configuration with the Memory Analysis tool. In the Session View panel the session is connected with a green triangle but no informations are showed. I see 0 events in both Memory Events panel and Memory Problems panel.
The official documentation here seem to not help much:
What is the correct way to start this tool ?
What operations should I do after the app and the tool are started ?
01-10-2014 02:18 PM
If you build a debug version of the app and run it normally does it work?
If not it is crashing or hanging and you need to fix that first (which may or may not be a memory leak).
01-10-2014 02:19 PM
01-13-2014 03:31 AM
If I run the app in debug mode it doesn't crash or it crash later when I activate manually some operation by clicking the specific button on the gui.
I get the SIGKILL signal in the Debug panel but i can't see a useful call stack to understand what the problem is.
01-13-2014 04:50 AM
01-13-2014 06:07 AM - edited 01-13-2014 08:58 AM
Setting a breakpoint doesn't get me to a clue because there is a memory leak and the app doesn't crash on the line that cause that problem. The Debug panel just show a useless stack of functions that are not mine but part of the BB10 API.
If I comment the function that I know cause the memory leak I have no problems, indeed I tried to open and use the app many time with the line commented and the crash doesn't appear.
However this is HOW I SOLVED the issue with the Virtual Memory tool.
1 - Reboot the phone
2 - Set the debug mode
3 - Close the SDK and reopen it
4 - Relaunch the app configuration
5 - Wait after the _start() symbol is reached until the first line of the main is highlighted
The point 6 is very important. If I press resume before the app is compleately runned the app is closed and the debugger detached. So we need to wait after the _start() page is opened in order to debug the app.
This page also was useful to me:
especially the steps listed there.