Specifications
Red Hat Enterprise Linux to Oracle Solaris Porting Guide
16
uncover a.out.uc
A GUI will then appear for viewing coverage data.
Memory Leak Detection
One of the most powerful tools that is bundled with Oracle Solaris Studio is Discover, which is a
memory error discovery tool for detecting memory access errors and leaks.
To use Discoverer, the following steps must be performed:
• As a prerequisite, the code must be compiled with Oracle Solaris Studio compiler optimization flags
-xO[n]:
cc -g -xO2 test.c
•
Instrumentation codes need to be added to the binary:
discover -w text a.out
Note: Discover automatically adds instrumentation to shared libraries when they are opened.
• Once instrumentation is added, the instrumented binary can be run and the usual testing, including
stress tests, can be continued.
• The tool will track all the memory leaks during the runs, which can be viewed through the report
generated by the tool.