NAME
psmwatch - PSM memory partition activity monitor
SYNOPSIS
psmwatch [ interval [ count [ verbose ]]]
psmwatch shared_memory_key memory_size partition_name interval count [ verbose ]
psmwatch -d [ interval_minutes [ percent_threshold ] ] [ shared_memory_key memory_size partition_name ]
DESCRIPTION
For count interations, psmwatch sleeps interval seconds and then invokes the psm_print_trace() function (see psm(3)) to report on PSM dynamic memory management activity in the PSM-managed shared memory partition identified by shared_memory_key (hexidecimal or decimal) during that interval. If the optional verbose parameter is specified, the printed PSM activity trace will be verbose as described in psm(3).
If shared_memory_key, memory_size, and partition_name are omitted, psmwatch will auto-detect these parameters from the ION configuration.
To prevent confusion, when explicit parameters are specified, the memory_size and partition_name are compared to those declared when this shared memory partition was initially managed; if they don't match, psmwatch immediately terminates.
If interval is zero, psmwatch merely prints a current usage summary for the indicated shared-memory partition and terminates. If negative, psmwatch will repeat with intervals of -interval seconds until interrupted but will disable any memory tracing.
psmwatch is helpful for detecting and diagnosing memory leaks. For debugging the ION protocol stack:
Daemon Mode
When invoked with the -d flag, psmwatch runs as a background daemon that periodically reports PSM partition usage percentage to ion.log. No memory allocation tracing is performed in this mode, minimizing overhead.
The daemon reports usage when either:
- The reporting interval elapses (default: 10 minutes)
- The usage percentage crosses a threshold boundary (default: 5%, meaning reports occur when usage crosses 5%, 10%, 15%, etc.)
If shared_memory_key, memory_size, and partition_name are omitted, psmwatch will attach to ION and use the default working memory partition parameters from the ION configuration.
-
interval_minutes
Reporting interval in minutes. Default is 10.
-
percent_threshold
Percentage threshold for change reporting. Default is 5, meaning a report is generated whenever usage crosses any multiple of 5%.
The daemon can be stopped by sending SIGTERM or SIGINT to the process.
Standard Mode
For debugging the ION protocol stack:
-
shared_memory_key
Normally "65281", but might be overridden by the value of wmKey in the .ionconfig file used to configure the node under study.
-
memory_size
As given by the value of wmKey in the .ionconfig file used to configure the node under study. If this value is not stated in the .ionconfig file, the default value is "5000000".
-
partition_name
Always "ionwm".
EXIT STATUS
-
"0"
psmwatch has terminated.
FILES
No configuration files are needed.
ENVIRONMENT
No environment variables apply.
DIAGNOSTICS
The following diagnostics may be issued to the ion.log log file:
-
Can't attach to psm.
ION system error. One possible cause is that ION has not yet been initialized on the local computer; run ionadmin(1) to correct this.
-
Can't start trace.
Insufficient ION working memory to contain trace information. Reinitialize ION with more memory.
BUGS
Report bugs to <https://github.com/nasa-jpl/ION-DTN/issues>
SEE ALSO
sdrwatch(1), psm(3)