Dynamic Memory Debugging
The Oracle Solaris OS and Oracle Developer Studio software contain tools for finding and eliminating errors in dynamic memory use.
Oracle Solaris tools for debugging dynamic memory include the following:
-
watchmalloc
is a debugging memory allocator library. For more information, see thewatchmalloc
(3MALLOC) man page. -
libumem
is a memory management library. You can uselibumem
to detect memory management bugs.libumem
is a user space slab allocation library, which performs object caching that results in caching the frequently allocated and freed memory. Object caching reduces the overhead of creating and releasing the memory. You can view the information about memory cache, memory allocation, and memory corruption using Modular Debugger (MDB). For information about modular debugger, see Oracle Solaris Modular Debugger Guide. -
You can also use the
libadimalloc
library on platforms that support ADI. The functions in thelibadimalloc
library provide scalable object-caching memory allocation with multithreaded application support. Also, this library uses ADI to detect buffer overrun errors, out-of-bounds pointer errors, stale pointer errors, and use-after-free errors. For more information, see thelibadimalloc
(3LIB) man page.
The Oracle Developer Studio tools for debugging dynamic memory include the following:
-
dbx
is an interactive, source-level, command-line debugging tool. You can use it to run a program in a controlled manner and to inspect the state of a stopped program.dbx
gives you complete control of the dynamic execution of a program, which includes collecting performance and memory usage data, monitoring memory access, and detecting memory leaks.dbxtool
provides a graphical user interface fordbx
. For more information, see Oracle Developer Studio 12.6: Debugging a Program With dbxOracle Developer Studio 12.6: Debugging a Program With dbx. -
The Run Time Checking (RTC) tool enables you to automatically detect runtime errors, such as memory access errors and memory leak, in a native code application during the development phase. It also allows you to monitor memory usage. You cannot use runtime checking on a Java code. For more information about using RTC, see Chapter 9, Using Runtime Checking, in Oracle Developer Studio 12.6: Debugging a Program With dbxOracle Developer Studio 12.6: Debugging a Program With dbx.
-
The advanced development tool "Memory Error Discovery Tool (Discover)" can also detect memory access errors. For more information, see the Oracle Developer Studio 12.6 Discover and Uncover User's GuideOracle Developer Studio 12.6 Discover and Uncover User's Guide.
Oracle Developer Studio is available on as a package to download and install on the Oracle Solaris OS. For more information, see the Download Options for Oracle Developer Studio.