Android
View all Process memory usage
(1) Connect the device, open the Use debug mode
(2) Open command line, execute command: adb shell Procrank
Field Description:
PID: Process ID
VSS (Virtual Set Size): Virtualized memory consumption (contains memory consumed by shared libraries)
RSS (Resident Set Size): Actual use of physical memory (contains memory consumed by shared libraries)
PSS (Proportional Set Size): Actual physical memory Used (proportional allocation of memory consumed by shared libraries)
USS (Unique Set Size): Physical memory occupied by the process alone (does not contain memory consumed by shared libraries)
CmdLine: Process Name
View heap Information
1. Open Eclipse's Ddms window and select the app you want to see
2. Click Update Heap
3. Click the Cause GC button to trigger the Java Memory Recycling mechanism, and then click to display the heap information of the process in the heap window and refresh periodically.
Field Description:
Heap Size: Total heap Memory size
Allocated: Amount of heap memory used
Free: Idle heap memory size
Used: Percentage of heap memory size used
Objects: Number of objects
Memory Leak Detection Tool (VLD)
Tools
1:https://vld.codeplex.com/releases
2:http://pan.baidu.com/s/1gd7vqnd
After the installation is complete, projects created using Visual Studio will default to include the VLD header file directory.
And the runtime in the Bin directory has been automatically added to the path variable.
All we need to do is include <VLD.H> in the source code, which is usually included in the project portal file.
Here, I manually created a memory leak. Lines 10th and 12th in Map.cpp.
After the program branch ends, the dynamically allocated memory is detected without delete or free, and the information about its memory leaks is output in the Output-debug window.
This indicates that a memory leak occurred on line 10th of main.cpp, leaking 8 bytes, and clicking on the line of code that can be directly located to the memory leak. The number of memory leaks in the digital surface behind the block.
Memory analysis and memory leak detection