Sun WorkShop Memory Monitor comes with a special tool called the Memory Debugger, or memdb. The Memory Debugger runs on an executable program without the need to explicitly link with the debugging library (libgc_dbg). This means you can debug your program with our web user interface in one easy step, without relinking or rebuilding, even if you don't have the source code! Just type in the memdb command (arguments below) and it will automatically launch your application, the GC Monitor, and your web browser (set to the debugging URL).
Here are some suggested uses for the Memory Debugger:
memdb [-d] [-g] [-b] [-v] [-w web browser] [-p port] [-m monfilepath] command
The arguments are explained below. "Command" refers the name of the program you wish to debug.
Argument | Details |
-d | Tells the Memory Debugger not to delete the monitor files after your program and the web browser stop running. |
-g | Tells the Memory Debugger not to automatically run the GC Monitor and web browser. |
-b | Tells the Memory Debugger not to automatically run the web browser. |
-v | Sets the Memory Debugger to verbose mode. |
-w browser | Sets a specific web browser. The web browser should be able to handle a URL in the first argument. The default web browser is "netscape". |
-p port | Sets the GC Monitor port. By default a random unused port is chosen. |
Sets the directory where the GC Monitor files are stored. We recommend creating this directory in a local disk to decrease the communication overhead between the program and the GC Monitor. |
Troubleshooting the Memory Debugger
Problem
My program shows the following error:
!!! **** Could not reopen gcmonitor file.
Solution
Some child processes that your program created are still running, and you may have exited the web browser. Do not exit the web browser until you are sure the child processes have finished executing. Alternatively, use the "-d" flag to preserve the gcmonfiles, and manually delete the gcmonfiles when you are done.
Problem
The web browser is not able to connect to the gcmonitor.
Solution
See Troubleshooting the GC Monitor for more information.