svmon
This command captures snapshots of virtual memory. Using svmon to take snapshots of the memory usage of a process over regular intervals allows you to monitor memory usage.
The following usage of svmon generates regular snapshots of a
process memory usage and writes the output to a file:
svmon -P [process id] -m -r -i [interval] > output.file
Gives
output like: Pid Command Inuse Pin Pgsp Virtual 64-bit Mthrd
25084 AppS 78907 1570 182 67840 N Y
Vsid Esid Type Description Inuse Pin Pgsp Virtual Addr Range
2c7ea 3 work shmat/mmap 36678 0 0 36656 0..65513
3c80e 4 work shmat/mmap 7956 0 0 7956 0..65515
5cd36 5 work shmat/mmap 7946 0 0 7946 0..65517
14e04 6 work shmat/mmap 7151 0 0 7151 0..65519
7001c d work shared library text 6781 0 0 736 0..65535
0 0 work kernel seg 4218 1552 182 3602 0..22017 :
65474..65535
6cb5a 7 work shmat/mmap 2157 0 0 2157 0..65461
48733 c work shmat/mmap 1244 0 0 1244 0..1243
cac3 - pers /dev/hd2:176297 1159 0 - - 0..1158
54bb5 - pers /dev/hd2:176307 473 0 - - 0..472
78b9e - pers /dev/hd2:176301 454 0 - - 0..453
58bb6 - pers /dev/hd2:176308 254 0 - - 0..253
cee2 - work 246 17 0 246 0..49746
4cbb3 - pers /dev/hd2:176305 226 0 - - 0..225
7881e - pers /dev/e2axa702-1:2048 186 0 - - 0..1856
68f5b - pers /dev/e2axa702-1:2048 185 0 - - 0..1847
28b8a - pers /dev/hd2:176299 119 0 - - 0..118
108c4 - pers /dev/e2axa702-1:1843 109 0 - - 0..1087
24b68 f work shared library data 97 0 0 78 0..1470
64bb9 - pers /dev/hd2:176311 93 0 - - 0..92
74bbd - pers /dev/hd2:176315 68 0 - - 0..67
3082d 2 work process private 68 1 0 68 65287..65535
10bc4 - pers /dev/hd2:176322 63 0 - - 0..62
50815 1 pers code,/dev/hd2:210969 9 0 - - 0..8
44bb1 - pers /dev/hd2:176303 7 0 - - 0..6
7c83e - pers /dev/e2axa702-1:2048 4 0 - - 0..300
34a6c a mmap mapped to sid 44ab0 0 0 - -
70b3d 8 mmap mapped to sid 1c866 0 0 - -
5cb36 b mmap mapped to sid 7cb5e 0 0 - -
58b37 9 mmap mapped to sid 1cb66 0 0 - -
1c7c7 - pers /dev/hd2:243801 0 0 - -
in which:
- Vsid
- Segment ID
- Esid
- Segment ID: corresponds to virtual memory segment. The Esid maps to the Virtual Memory Manager segments. By understanding the memory model that is being used by the JVM, you can use these values to determine whether you are allocating or committing memory on the native or Java™ heap.
- Type
- Identifies
the type of the segment:
- pers
- Indicates a persistent segment.
- work
- Indicates a working segment.
- clnt
- Indicates a client segment.
- mmap
- Indicates a mapped segment. This is memory allocated using mmap in a large memory model program.
- Description
-
If the segment is a persistent segment, the device name and i-node number of the associated file are displayed.
If the segment is a persistent segment and is associated with a log, the string log is displayed.
If the segment is a working segment, the svmon command attempts to determine the role of the segment:- kernel
- The segment is used by the kernel.
- shared library
- The segment is used for shared library text or data.
- process private
- Private data for the process.
- shmat/mmap
- Shared memory segments that are being used for process private data, because you are using a large memory model program.
- Inuse
- The number of pages in real memory from this segment.
- Pin
- The number of pages pinned from this segment.
- Pgsp
- The number of pages used on paging space by this segment. This value is relevant only for working segments.
- Addr Range
- The range of pages that have been allocated in this segment. Addr Range displays the range of pages that have been allocated in each segment, whereas Inuse displays the number of pages that have been committed. For instance, Addr Range might detail more pages than Inuse because pages have been allocated that are not yet in use.