Once we observe linear memory growth during endurance load testing, we could suspect about memory leak in application
1. C++ -
we can use following tool to analyse memory leak in c++ application
1. valgrind : -
- Valgrind is tool with which we can analyses memory leak for C++ application.
On linux machine it should available. Start the application with below parameters. Note- Your application will become slow once you start with valgrind.
valgrind --tool=memcheck --leak-check=full --show-reachable=yes --num-callers=20 --track-fds=yes --leak-resolution=high --trace-children=yes -v <binary file> <arg1> <arg2>
- valigrind report analysis : - Check following categories from text report.
Still reachable blocks
Definitely Lost blocks
Indirectly Lost:
Possibly Lost
Reference :-
http://valgrind.org/docs/manual/manual.html
2. Java -
1. Eclipse Memory Analysis Tool - We used E-MAT to analyse heapdump(generate by application because of HeapDumpOnOutOfMemoryError). We loaded 2G heapdump in E-MAT ( Note:- E-MAT machine having 32G memory and 12 core cpu)
- once heapdump gets load in tool, it will provide following high level report
- Leak Suspect Report :- shows classes/object which consumed more heap.
- Check Histogram of dominator tree :- Check Retained Heap size ( retained heap si addition of the shallow heap size of all objects that would be removed when this object is garbage collected)
here max retained heap size instances could be suspected objects. If we drill down dominator tree more, we can identify object which holds more memory
Reference link:-
http://eclipsesource.com/blogs/2013/01/21/10-tips-for-using-the-eclipse-memory-analyzer/
2. JVisualVM :-
we can analyaze java application using jvisualvm tool(D:\test\jdk1.7.0_45\bin\jvisualvm.exe) by locally or remotely
- we can monitor :- CPU usage, heap, no. of threads
- Thread analysis
- Profiler - we can monitor CPU uses by each method
- In memory profiling visualvm, gives max usage of heap by classes, instances.
- VisualGC - We need install VisualGC plugin from Tool > Plugins
- This plugin monitor GC activity - the Perm gen, Eden space, GC time
For more detail please go through below link :-
http://myloadtesting.blogspot.in/2015/02/performance-analysis-using-jvisualvm.html
1. C++ -
we can use following tool to analyse memory leak in c++ application
1. valgrind : -
- Valgrind is tool with which we can analyses memory leak for C++ application.
On linux machine it should available. Start the application with below parameters. Note- Your application will become slow once you start with valgrind.
valgrind --tool=memcheck --leak-check=full --show-reachable=yes --num-callers=20 --track-fds=yes --leak-resolution=high --trace-children=yes -v <binary file> <arg1> <arg2>
- valigrind report analysis : - Check following categories from text report.
Still reachable blocks
Definitely Lost blocks
Indirectly Lost:
Possibly Lost
Reference :-
http://valgrind.org/docs/manual/manual.html
2. Java -
1. Eclipse Memory Analysis Tool - We used E-MAT to analyse heapdump(generate by application because of HeapDumpOnOutOfMemoryError). We loaded 2G heapdump in E-MAT ( Note:- E-MAT machine having 32G memory and 12 core cpu)
- once heapdump gets load in tool, it will provide following high level report
- Leak Suspect Report :- shows classes/object which consumed more heap.
- Check Histogram of dominator tree :- Check Retained Heap size ( retained heap si addition of the shallow heap size of all objects that would be removed when this object is garbage collected)
here max retained heap size instances could be suspected objects. If we drill down dominator tree more, we can identify object which holds more memory
Reference link:-
http://eclipsesource.com/blogs/2013/01/21/10-tips-for-using-the-eclipse-memory-analyzer/
2. JVisualVM :-
we can analyaze java application using jvisualvm tool(D:\test\jdk1.7.0_45\bin\jvisualvm.exe) by locally or remotely
- we can monitor :- CPU usage, heap, no. of threads
- Thread analysis
- Profiler - we can monitor CPU uses by each method
- In memory profiling visualvm, gives max usage of heap by classes, instances.
- VisualGC - We need install VisualGC plugin from Tool > Plugins
- This plugin monitor GC activity - the Perm gen, Eden space, GC time
For more detail please go through below link :-
http://myloadtesting.blogspot.in/2015/02/performance-analysis-using-jvisualvm.html
Informative article.Thread Dump Analysis Tool
ReplyDelete