Merge commit 'b31ca922c7346747131aed07c0c171ec2f573aac' into merges
[unleashed.git] / share / man / man1 / pmap.1
blob28d9e3421cd7a20564c60ef23cdaa6d0a58ac055
1 '\" te
2 .\"  Copyright (c) 2006, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH PMAP 1 "April 9, 2016"
7 .SH NAME
8 pmap \- display information about the address space of a process
9 .SH SYNOPSIS
10 .LP
11 .nf
12 \fB/usr/bin/pmap\fR [\fB-rslF\fR] [\fB-A\fR \fIaddress_range\fR] [\fIpid\fR | \fIcore\fR]...
13 .fi
15 .LP
16 .nf
17 \fB/usr/bin/pmap\fR \fB-L\fR [\fB-rslF\fR] [\fB-A\fR \fIaddress_range\fR] [\fIpid\fR] ...
18 .fi
20 .LP
21 .nf
22 \fB/usr/bin/pmap\fR \fB-x\fR [\fB-aslF\fR] [\fB-A\fR \fIaddress_range\fR] [\fIpid\fR | \fIcore\fR]...
23 .fi
25 .LP
26 .nf
27 \fB/usr/bin/pmap\fR \fB-S\fR [\fB-alF\fR] [\fB-A\fR \fIaddress_range\fR] [\fIpid\fR | \fIcore\fR]...
28 .fi
30 .SH DESCRIPTION
31 .LP
32 The \fBpmap\fR utility prints information about the address space of a process.
33 .SH OPTIONS
34 .LP
35 The following options are supported:
36 .sp
37 .ne 2
38 .na
39 \fB\fB-a\fR\fR
40 .ad
41 .RS 20n
42 Prints anonymous and swap reservations for shared mappings.
43 .RE
45 .sp
46 .ne 2
47 .na
48 \fB\fB-A\fR \fIaddress_range\fR\fR
49 .ad
50 .RS 20n
51 Specifies the subrange of address space to display. \fIaddress_range\fR is
52 specified in one of the following forms:
53 .sp
54 .ne 2
55 .na
56 \fB\fIstart_addr\fR\fR
57 .ad
58 .sp .6
59 .RS 4n
60 A single address limits the output to the segment (or the page if the \fB-L\fR
61 option is present) containing that address. If the specified address
62 corresponds to the starting address of a segment, the output always includes
63 the whole segment even when the \fB-L\fR option is specified.
64 .RE
66 .sp
67 .ne 2
68 .na
69 \fB\fIstart_addr\fR\fB,\fR\fR
70 .ad
71 .sp .6
72 .RS 4n
73 An address followed by comma without the end address limits the output to all
74 segments (or pages if the \fB-L\fR option is present) starting from the one
75 containing the specified address.
76 .RE
78 .sp
79 .ne 2
80 .na
81 \fB\fIstart_addr\fR\fB,\fR\fIend_addr\fR\fR
82 .ad
83 .sp .6
84 .RS 4n
85 An address range specified by the start address and end addresses limits the
86 output to all segments (or pages if the \fB-L\fR option is present) starting
87 from the segment or page containing the start address through the segment or
88 page containing the end address.
89 .RE
91 .sp
92 .ne 2
93 .na
94 \fB\fB,\fR\fIend_addr\fR\fR
95 .ad
96 .sp .6
97 .RS 4n
98 An address range started with comma without the start address limits the output
99 to all segments (or pages if the \fB-L\fR option is present) starting from the
100 first one present until the segment (or page if the \fB-L\fR option is present)
101 containing the specified address.
107 .ne 2
109 \fB\fB-F\fR\fR
111 .RS 20n
112 Force. Grabs the target process even if another process has control.
114 See \fBUSAGE\fR.
118 .ne 2
120 \fB\fB-l\fR\fR
122 .RS 20n
123 Shows unresolved dynamic linker map names.
127 .ne 2
129 \fB\fB-L\fR\fR
131 .RS 20n
132 Prints lgroup containing physical memory that backs virtual memory.
136 .ne 2
138 \fB\fB-r\fR\fR
140 .RS 20n
141 Prints the process's reserved addresses.
145 .ne 2
147 \fB\fB-s\fR\fR
149 .RS 20n
150 Prints \fBHAT\fR page size information.
154 .ne 2
156 \fB\fB-S\fR\fR
158 .RS 20n
159 Displays swap reservation information per mapping. See USAGE for more
160 information.
164 .ne 2
166 \fB\fB-x\fR\fR
168 .RS 20n
169 Displays additional information per mapping. See USAGE for more information.
172 .SH USAGE
174 The \fBpmap\fR utility prints information about the address space of a process.
176 .ne 2
178 \fBProcess Mappings\fR
180 .sp .6
181 .RS 4n
183 .in +2
185 /usr/bin/pmap [ -rslF ] [-A \fIaddress_range\fR] [ \fIpid\fR | \fIcore\fR ] ...
187 .in -2
190 By default, \fBpmap\fR displays all of the mappings in the virtual address
191 order they are mapped into the process. The mapping size, flags, and mapped
192 object name are shown.
194 The \fB-A\fR option can be used to limit the output to a specified address
195 range. The specified addresses are rounded up or down to a segment boundary and
196 the output includes the segments bounded by those addresses.
200 .ne 2
202 \fBProcess Lgroup Mappings\fR
204 .sp .6
205 .RS 4n
207 .in +2
209 /usr/bin/pmap -L [ -rslF ] [-A \fIaddress_range\fR] \fIpid\fR ...
211 .in -2
214 The \fB-L\fR option can be used to determine the lgroup containing the physical
215 memory backing the specified virtual memory. When used with the \fB-A\fR
216 option, the specified addresses are rounded up or down to a page boundary and
217 the output is limited to the page or pages bounded by those addresses.
219 This can be used in conjunction with \fBplgrp\fR(1) to discover whether the
220 home lgroup of a thread of interest is the same as where the memory is located
221 and whether there should be memory locality for the thread. The
222 \fBlgrpinfo\fR(1) command can also be useful with this \fBpmap\fR option. It
223 displays the lgroup hierarchy, contents, and characteristics which gives more
224 information about the lgroups that the memory is distributed across and their
225 relationship to each other and any other lgroups of interest.
227 In addition, the thread and memory placement can be changed by using
228 \fBplgrp\fR(1), \fBpmadvise\fR(1), or \fBmadv.so.1\fR(1).
232 .ne 2
234 \fBProcess anon/locked mapping details\fR
236 .sp .6
237 .RS 4n
239 .in +2
241 /usr/bin/pmap -x [ -aslF ] [-A \fIaddress_range\fR] [ \fIpid\fR | \fIcore\fR ] ...
243 .in -2
246 The \fB-x\fR option displays additional information per mapping. The size of
247 each mapping, the amount of resident physical memory (RSS), the amount of
248 anonymous memory, and the amount of memory locked is shown with this option.
249 This does not include anonymous memory taken by kernel address space due to
250 this process.
254 .ne 2
256 \fBSwap Reservations\fR
258 .sp .6
259 .RS 4n
261 .in +2
263 /usr/bin/pmap -S [ -alF ] [-A \fIaddress_range\fR] [ \fIpid\fR | \fIcore\fR ] ...
265 .in -2
268 The \fB-S\fR option displays swap reservation information per mapping.
273 Caution should be exercised when using the \fB-F\fR flag. Imposing two
274 controlling processes on one victim process can lead to chaos. Safety is
275 assured only if the primary controlling process, typically a debugger, has
276 stopped the victim process and the primary controlling process is doing nothing
277 at the moment of application of the \fBproc\fR tool in question.
278 .SH DISPLAY FORMATS
280 One line of output is printed for each mapping within the process, unless the
281 -\fB-s\fR or -\fB-L\fR option is specified. With \fB-s\fR option, one line is
282 printed for a contiguous mapping of each hardware translation page size. With
283 \fB-L\fR option one line is printed for a contiguous mapping belonging to the
284 same lgroup. With both \fB-L\fR and \fB-s\fR options, one line is printed for a
285 contiguous mapping of each hardware translation page size belonging to the same
286 lgroup. The column headings are shown in parentheses below.
288 .ne 2
290 \fBVirtual Address (\fBAddress\fR)\fR
292 .sp .6
293 .RS 4n
294 The first column of output represents the starting virtual address of each
295 mapping. Virtual addresses are displayed in ascending order.
299 .ne 2
301 \fBVirtual Mapping Size (\fBKbytes\fR)\fR
303 .sp .6
304 .RS 4n
305 The virtual size in kilobytes of each mapping.
309 .ne 2
311 \fBResident Physical Memory (\fBRSS\fR)\fR
313 .sp .6
314 .RS 4n
315 The amount of physical memory in kilobytes that is resident for each mapping,
316 including that which is shared with other address spaces.
320 .ne 2
322 \fBAnonymous Memory (\fBAnon\fR)\fR
324 .sp .6
325 .RS 4n
326 The number of pages, counted by using the system page size, of anonymous memory
327 associated with the specified mapping. Anonymous memory shared with other
328 address spaces is not included, unless the \fB-a\fR option is specified.
330 Anonymous memory is reported for the process heap, stack, for 'copy on write'
331 pages with mappings mapped with \fBMAP_PRIVATE\fR (see \fBmmap\fR(2)).
335 .ne 2
337 \fBLocked (\fBLocked\fR)\fR
339 .sp .6
340 .RS 4n
341 The number of pages locked within the mapping. Typical examples are memory
342 locked with \fBmlock()\fR and System V shared memory created with
343 \fBSHM_SHARE_MMU\fR.
347 .ne 2
349 \fBPermissions/Flags (\fBMode\fR)\fR
351 .sp .6
352 .RS 4n
353 The virtual memory permissions are shown for each mapping. Valid permissions
354 are:
356 .ne 2
358 \fB\fBr:\fR\fR
360 .RS 6n
361 The mapping can be read by the process.
365 .ne 2
367 \fB\fBw:\fR\fR
369 .RS 6n
370 The mapping can be written by the process.
374 .ne 2
376 \fB\fBx:\fR\fR
378 .RS 6n
379 Instructions that reside within the mapping can be executed by the process.
382 Flags showing additional information for each mapping can be displayed:
384 .ne 2
386 \fB\fBs:\fR\fR
388 .RS 6n
389 The mapping is shared such that changes made in the observed address space are
390 committed to the mapped file, and are visible from all other processes sharing
391 the mapping.
395 .ne 2
397 \fB\fBR:\fR\fR
399 .RS 6n
400 Swap space is not reserved for this mapping. Mappings created with
401 \fBMAP_NORESERVE\fR and System V \fBISM\fR shared memory mappings do not
402 reserve swap space.
406 .ne 2
408 \fB\fB*:\fR\fR
410 .RS 6n
411 The data for the mapping is not present in the core file (only applicable when
412 applied to a core file). See \fBcoreadm\fR(8) for information on configuring
413 core file content.
419 .ne 2
421 \fBLgroup (\fBLgrp\fR)\fR
423 .sp .6
424 .RS 4n
425 The lgroup containing the physical memory that backs the specified mapping.
429 .ne 2
431 \fBMapping Name (\fBMapped File\fR)\fR
433 .sp .6
434 .RS 4n
435 A descriptive name for each mapping. The following major types of names are
436 displayed for mappings:
437 .RS +4
439 .ie t \(bu
440 .el o
441 \fBA mapped file:\fR For mappings between a process and a file, the \fBpmap\fR
442 command attempts to resolve the file name for each mapping. If the file name
443 cannot be resolved, \fBpmap\fR displays the major and minor number of the
444 device containing the file, and the file system inode number of the file.
446 .RS +4
448 .ie t \(bu
449 .el o
450 \fBAnonymous memory:\fR Memory not relating to any named object or file within
451 the file system is reported as \fB[ anon ]\fR.
453 The \fBpmap\fR command displays common names for certain known anonymous memory
454 mappings:
458 .ne 2
460 \fB\fB[ heap ]\fR\fR
462 .RS 22n
463 The mapping is the process heap.
467 .ne 2
469 \fB\fB[ stack ]\fR\fR
471 .RS 22n
472 The mapping is the main stack.
476 .ne 2
478 \fB\fB[ stack tid=\fIn\fR ]\fR\fR
480 .RS 22n
481 The mapping is the stack for thread \fIn\fR.
485 .ne 2
487 \fB\fB[ altstack tid=\fIn\fR ]\fR\fR
489 .RS 22n
490 The mapping is used as the alternate signal stack for thread \fIn\fR.
495 If the common name for the mapping is unknown, \fBpmap\fR displays \fB[ anon
496 ]\fR as the mapping name.
498 .RS +4
500 .ie t \(bu
501 .el o
502 \fBSystem V Shared Memory:\fR Mappings created using System V shared memory
503 system calls are reported with the names shown below:
507 .ne 2
509 \fB\fBshmid=n:\fR\fR
511 .RS 17n
512 The mapping is a System V shared memory mapping. The shared memory identifier
513 that the mapping was created with is reported.
517 .ne 2
519 \fB\fBism shmid=n:\fR\fR
521 .RS 17n
522 The mapping is an "Intimate Shared Memory" variant of System V shared memory.
523 \fBISM\fR mappings are created with the \fBSHM_SHARE_MMU\fR flag set, in
524 accordance with \fBshmat\fR(2) (see \fBshmop\fR(2)).
528 .ne 2
530 \fB\fBdism shmid=n:\fR\fR
532 .RS 17n
533 The mapping is a pageable variant of \fBISM\fR. Pageable \fBISM\fR is created
534 with the \fBSHM_PAGEABLE\fR flag set in accordance with \fBshmat\fR(2) (see
535 \fBshmop\fR(2)).
541 .RS +4
543 .ie t \(bu
544 .el o
545 \fBOther:\fR Mappings of other objects, including devices such as frame
546 buffers. No mapping name is shown for other mapped objects.
551 .ne 2
553 \fBPage Size (\fBPgsz\fR)\fR
555 .sp .6
556 .RS 4n
557 The page size in kilobytes that is used for hardware address translation for
558 this mapping. See \fBmemcntl\fR(2) for further information.
562 .ne 2
564 \fBSwap Space (\fBSwap\fR)\fR
566 .sp .6
567 .RS 4n
568 The amount of swap space in kilobytes that is reserved for this mapping. That
569 is, swap space that is deducted from the total available pool of reservable
570 swap space that is displayed with the command \fBswap\fR \fB-s\fR. See
571 \fBswap\fR(8).
574 .SH EXAMPLES
576 \fBExample 1 \fRDisplaying Process Mappings
579 By default, \fBpmap\fR prints one line for each mapping within the address
580 space of the target process. The following example displays the address space
581 of a typical bourne shell:
584 .in +2
586 example$ pmap 102905
587 102905:    sh
588 00010000    192K r-x--  /usr/bin/ksh
589 00040000      8K rwx--  /usr/bin/ksh
590 00042000     40K rwx--    [ heap ]
591 FF180000    664K r-x--  /usr/lib/libc.so.1
592 FF236000     24K rwx--  /usr/lib/libc.so.1
593 FF23C000      8K rwx--  /usr/lib/libc.so.1
594 FF250000      8K rwx--    [ anon ]
595 FF260000     16K r-x--  /usr/lib/en_US.ISO8859-1.so.2
596 FF272000     16K rwx--  /usr/lib/en_US.ISO8859-1.so.2
597 FF280000    560K r-x--  /usr/lib/libnsl.so.1
598 FF31C000     32K rwx--  /usr/lib/libnsl.so.1
599 FF324000     32K rwx--  /usr/lib/libnsl.so.1
600 FF340000     16K r-x--  /usr/lib/libc_psr.so.1
601 FF350000     16K r-x--  /usr/lib/libmp.so.2
602 FF364000      8K rwx--  /usr/lib/libmp.so.2
603 FF380000     40K r-x--  /usr/lib/libsocket.so.1
604 FF39A000      8K rwx--  /usr/lib/libsocket.so.1
605 FF3A0000      8K r-x--  /usr/lib/libdl.so.1
606 FF3B0000      8K rwx--    [ anon ]
607 FF3C0000    152K r-x--  /usr/lib/ld.so.1
608 FF3F6000      8K rwx--  /usr/lib/ld.so.1
609 FFBFC000     16K rw---    [ stack ]
610  total     1880K
612 .in -2
616 \fBExample 2 \fRDisplaying Memory Allocation and Mapping Types
619 The \fB-x\fR option can be used to provide information about the memory
620 allocation and mapping types per mapping. The amount of resident, non-shared
621 anonymous, and locked memory is shown for each mapping:
624 .in +2
626 example$ pmap -x 102908
627 102908:   sh
628 Address   Kbytes     RSS    Anon  Locked Mode   Mapped File
629 00010000      88      88       -       - r-x--  sh
630 00036000       8       8       8       - rwx--  sh
631 00038000      16      16      16       - rwx--    [ heap ]
632 FF260000      16      16       -       - r-x--  en_US.ISO8859-1.so.2
633 FF272000      16      16       -       - rwx--  en_US.ISO8859-1.so.2
634 FF280000     664     624       -       - r-x--  libc.so.1
635 FF336000      32      32       8       - rwx--  libc.so.1
636 FF360000      16      16       -       - r-x--  libc_psr.so.1
637 FF380000      24      24       -       - r-x--  libgen.so.1
638 FF396000       8       8       -       - rwx--  libgen.so.1
639 FF3A0000       8       8       -       - r-x--  libdl.so.1
640 FF3B0000       8       8       8       - rwx--    [ anon ]
641 FF3C0000     152     152       -       - r-x--  ld.so.1
642 FF3F6000       8       8       8       - rwx--  ld.so.1
643 FFBFE000       8       8       8       - rw---    [ stack ]
644 --------   -----   -----   -----   ------
645 total Kb    1072    1032      56       -
647 .in -2
652 The amount of incremental memory used by each additional instance of a process
653 can be estimated by using the resident and anonymous memory counts of each
654 mapping.
658 In the above example, the bourne shell has a resident memory size of
659 1032Kbytes. However, a large amount of the physical memory used by the shell is
660 shared with other instances of shell. Another identical instance of the shell
661 shares physical memory with the other shell where possible, and allocate
662 anonymous memory for any non-shared portion. In the above example, each
663 additional bourne shell uses approximately 56Kbytes of additional physical
664 memory.
668 A more complex example shows the output format for a process containing
669 different mapping types. In this example, the mappings are as follows:
672 .in +2
674 0001000: Executable text, mapped from 'maps' program
676 0002000: Executable data, mapped from 'maps' program
678 0002200: Program heap
681 0300000: A mapped file, mapped MAP_SHARED
682 0400000: A mapped file, mapped MAP_PRIVATE
684 0500000: A mapped file, mapped MAP_PRIVATE | MAP_NORESERVE
686 0600000: Anonymous memory, created by mapping /dev/zero
688 0700000: Anonymous memory, created by mapping /dev/zero
689          with MAP_NORESERVE
691 0800000: A DISM shared memory mapping, created with SHM_PAGEABLE
692          with 8MB locked via mlock(3C)
694 0900000: A DISM shared memory mapping, created with SHM_PAGEABLE,
695          with 4MB of its pages touched.
697 0A00000: A DISM shared memory mapping, created with SHM_PAGEABLE,
698          with none of its pages touched.
700 0B00000: An ISM shared memory mapping, created with SHM_SHARE_MMU
702 .in -2
706 .in +2
708 example$ pmap -x 15492
709 15492:  ./maps
710  Address  Kbytes     RSS    Anon  Locked Mode   Mapped File
711 00010000       8       8       -       - r-x--  maps
712 00020000       8       8       8       - rwx--  maps
713 00022000   20344   16248   16248       - rwx--    [ heap ]
714 03000000    1024    1024       -       - rw-s-  dev:0,2 ino:4628487
715 04000000    1024    1024     512       - rw---  dev:0,2 ino:4628487
716 05000000    1024    1024     512       - rw--R  dev:0,2 ino:4628487
717 06000000    1024    1024    1024       - rw---    [ anon ]
718 07000000     512     512     512       - rw--R    [ anon ]
719 08000000    8192    8192       -    8192 rwxs-    [ dism shmid=0x5]
720 09000000    8192    4096       -       - rwxs-    [ dism shmid=0x4]
721 0A000000    8192    8192       -    8192 rwxsR    [ ism shmid=0x2 ]
722 0B000000    8192    8192       -    8192 rwxsR    [ ism shmid=0x3 ]
723 FF280000     680     672       -       - r-x--  libc.so.1
724 FF33A000      32      32      32       - rwx--  libc.so.1
725 FF390000       8       8       -       - r-x--  libc_psr.so.1
726 FF3A0000       8       8       -       - r-x--  libdl.so.1
727 FF3B0000       8       8       8       - rwx--    [ anon ]
728 FF3C0000     152     152       -       - r-x--  ld.so.1
729 FF3F6000       8       8       8       - rwx--  ld.so.1
730 FFBFA000      24      24      24       - rwx--    [ stack ]
731 -------- ------- ------- ------- -------
732 total Kb   50464   42264   18888   16384
734 .in -2
738 \fBExample 3 \fRDisplaying Page Size Information
741 The \fB-s\fR option can be used to display the hardware translation page sizes
742 for each portion of the address space. (See \fBmemcntl\fR(2) for further
743 information on illumos multiple page size support).
747 In the example below, we can see that the majority of the mappings are using an
748 8K-Byte page size, while the heap is using a 4M-Byte page size.
752 Notice that non-contiguous regions of resident pages of the same page size are
753 reported as separate mappings. In the example below, the \fBlibc.so\fR library
754 is reported as separate mappings, since only some of the \fBlibc.so\fR text is
755 resident:
758 .in +2
760 example$ pmap -xs 15492
761 15492:  ./maps
762  Address  Kbytes     RSS    Anon  Locked Pgsz Mode   Mapped File
763 00010000       8       8       -       -   8K r-x--  maps
764 00020000       8       8       8       -   8K rwx--  maps
765 00022000    3960    3960    3960       -   8K rwx--    [ heap ]
766 00400000    8192    8192    8192       -   4M rwx--    [ heap ]
767 00C00000    4096       -       -       -    - rwx--    [ heap ]
768 01000000    4096    4096    4096       -   4M rwx--    [ heap ]
769 03000000    1024    1024       -       -   8K rw-s-  dev:0,2 ino:4628487
770 04000000     512     512     512       -   8K rw---  dev:0,2 ino:4628487
771 04080000     512     512       -       -    - rw---  dev:0,2 ino:4628487
772 05000000     512     512     512       -   8K rw--R  dev:0,2 ino:4628487
773 05080000     512     512       -       -    - rw--R  dev:0,2 ino:4628487
774 06000000    1024    1024    1024       -   8K rw---    [ anon ]
775 07000000     512     512     512       -   8K rw--R    [ anon ]
776 08000000    8192    8192       -    8192    - rwxs-    [ dism shmid=0x5 ]
777 09000000    4096    4096       -       -   8K rwxs-    [ dism shmid=0x4 ]
778 0A000000    4096       -       -       -    - rwxs-    [ dism shmid=0x2 ]
779 0B000000    8192    8192       -    8192   4M rwxsR    [ ism shmid=0x3 ]
780 FF280000     136     136       -       -   8K r-x--  libc.so.1
781 FF2A2000     120     120       -       -    - r-x--  libc.so.1
782 FF2C0000     128     128       -       -   8K r-x--  libc.so.1
783 FF2E0000     200     200       -       -    - r-x--  libc.so.1
784 FF312000      48      48       -       -   8K r-x--  libc.so.1
785 FF31E000      48      40       -       -    - r-x--  libc.so.1
786 FF33A000      32      32      32       -   8K rwx--  libc.so.1
787 FF390000       8       8       -       -   8K r-x--  libc_psr.so.1
788 FF3A0000       8       8       -       -   8K r-x--  libdl.so.1
789 FF3B0000       8       8       8       -   8K rwx--    [ anon ]
790 FF3C0000     152     152       -       -   8K r-x--  ld.so.1
791 FF3F6000       8       8       8       -   8K rwx--  ld.so.1
792 FFBFA000      24      24      24       -   8K rwx--    [ stack ]
793      -------- ------- ------- ------- -------
794 total Kb   50464   42264   18888   16384
796 .in -2
800 \fBExample 4 \fRDisplaying Swap Reservations
803 The \fB-S\fR option can be used to describe the swap reservations for a
804 process. The amount of swap space reserved is displayed for each mapping within
805 the process. Swap reservations are reported as zero for shared mappings, since
806 they are accounted for only once system wide.
809 .in +2
811 example$ pmap -S 15492
812 15492:  ./maps
813  Address  Kbytes    Swap Mode   Mapped File
814 00010000       8       - r-x--  maps
815 00020000       8       8 rwx--  maps
816 00022000   20344   20344 rwx--    [ heap ]
817 03000000    1024       - rw-s-  dev:0,2 ino:4628487
818 04000000    1024    1024 rw---  dev:0,2 ino:4628487
819 05000000    1024     512 rw--R  dev:0,2 ino:4628487
820 06000000    1024    1024 rw---    [ anon ]
821 07000000     512     512 rw--R    [ anon ]
822 08000000    8192       - rwxs-    [ dism shmid=0x5]
823 09000000    8192       - rwxs-    [ dism shmid=0x4]
824 0A000000    8192       - rwxs-    [ dism shmid=0x2]
825 0B000000    8192       - rwxsR    [ ism shmid=0x3]
826 FF280000     680       - r-x--  libc.so.1
827 FF33A000      32      32 rwx--  libc.so.1
828 FF390000       8       - r-x--  libc_psr.so.1
829 FF3A0000       8       - r-x--  libdl.so.1
830 FF3B0000       8       8 rwx--    [ anon ]
831 FF3C0000     152       - r-x--  ld.so.1
832 FF3F6000       8       8 rwx--  ld.so.1
833 FFBFA000      24      24 rwx--    [ stack ]
834 -------- ------- -------
835 total Kb   50464   23496
837 .in -2
842 The swap reservation information can be used to estimate the amount of virtual
843 swap used by each additional process. Each process consumes virtual swap from a
844 global virtual swap pool. Global swap reservations are reported by
845 the '\fBavail\fR' field of the \fBswap\fR(8) command.
848 \fBExample 5 \fRLabeling Stacks in a Multi-threaded Process
850 .in +2
852 example$ pmap 121969
853 121969: ./stacks
854 00010000       8K r-x--  /tmp/stacks
855 00020000       8K rwx--  /tmp/stacks
856 FE8FA000       8K rwx-R    [ stack tid=11 ]
857 FE9FA000       8K rwx-R    [ stack tid=10 ]
858 FEAFA000       8K rwx-R    [ stack tid=9 ]
859 FEBFA000       8K rwx-R    [ stack tid=8 ]
860 FECFA000       8K rwx-R    [ stack tid=7 ]
861 FEDFA000       8K rwx-R    [ stack tid=6 ]
862 FEEFA000       8K rwx-R    [ stack tid=5 ]
863 FEFFA000       8K rwx-R    [ stack tid=4 ]
864 FF0FA000       8K rwx-R    [ stack tid=3 ]
865 FF1FA000       8K rwx-R    [ stack tid=2 ]
866 FF200000      64K rw---    [ altstack tid=8 ]
867 FF220000      64K rw---    [ altstack tid=4 ]
868 FF240000     112K rw---    [ anon ]
869 FF260000      16K rw---    [ anon ]
870 FF270000      16K r-x--  /usr/platform/sun4u/lib/libc_psr.so.1
871 FF280000     672K r-x--  /usr/lib/libc.so.1
872 FF338000      24K rwx--  /usr/lib/libc.so.1
873 FF33E000       8K rwx--  /usr/lib/libc.so.1
874 FF35A000       8K rwxs-    [ anon ]
875 FF360000     104K r-x--  /usr/lib/libthread.so.1
876 FF38A000       8K rwx--  /usr/lib/libthread.so.1
877 FF38C000       8K rwx--  /usr/lib/libthread.so.1
878 FF3A0000       8K r-x--  /usr/lib/libdl.so.1
879 FF3B0000       8K rwx--    [ anon ]
880 FF3C0000     152K r-x--  /usr/lib/ld.so.1
881 FF3F6000       8K rwx--  /usr/lib/ld.so.1
882 FFBFA000      24K rwx--    [ stack ]
883  total      1400K
885 .in -2
889 \fBExample 6 \fRDisplaying lgroup Memory Allocation
892 The following example displays lgroup memory allocation by mapping:
895 .in +2
897 example$ pmap -L `pgrep nscd`
898 100095: /usr/sbin/nscd
899 00010000       8K r-x--   2 /usr/sbin/nscd
900 00012000      48K r-x--   1 /usr/sbin/nscd
901 0002E000       8K rwx--   2 /usr/sbin/nscd
902 00030000      16K rwx--   2   [ heap ]
903 00034000       8K rwx--   1   [ heap ]
904          .
905          .
906          .
907 FD80A000      24K rwx--   2   [ anon ]
908 FD820000       8K r-x--   2 /lib/libmd5.so.1
909 FD840000      16K r-x--   1 /lib/libmp.so.2
910 FD860000       8K r-x--   2 /usr/lib/straddr.so.2
911 FD872000       8K rwx--   1 /usr/lib/straddr.so.2
912 FD97A000       8K rw--R   1   [ stack tid=24 ]
913 FD990000       8K r-x--   2 /lib/nss_nis.so.1
914 FD992000      16K r-x--   1 /lib/nss_nis.so.1
915 FD9A6000       8K rwx--   1 /lib/nss_nis.so.1
916 FD9C0000       8K rwx--   2   [ anon ]
917 FD9D0000       8K r-x--   2 /lib/nss_files.so.1
918 FD9D2000      16K r-x--   1 /lib/nss_files.so.1
919 FD9E6000       8K rwx--   2 /lib/nss_files.so.1
920 FDAFA000       8K rw--R   2   [ stack tid=23 ]
921 FDBFA000       8K rw--R   1   [ stack tid=22 ]
922 FDCFA000       8K rw--R   1   [ stack tid=21 ]
923 FDDFA000       8K rw--R   1   [ stack tid=20 ]
924     .
925     .
926     .
927 FEFFA000       8K rw--R   1   [ stack tid=2 ]
928 FF000000       8K rwx--   2   [ anon ]
929 FF004000      16K rwx--   1   [ anon ]
930 FF00A000      16K rwx--   1   [ anon ]
931     .
932     .
933     .
934 FF3EE000       8K rwx--   2 /lib/ld.so.1
935 FFBFE000       8K rw---   2   [ stack ]
936  total      2968K
938 .in -2
941 .SH EXIT STATUS
943 The following exit values are returned:
945 .ne 2
947 \fB\fB0\fR\fR
949 .RS 12n
950 Successful operation.
954 .ne 2
956 \fBnon-zero\fR
958 .RS 12n
959 An error has occurred.
962 .SH FILES
963 .ne 2
965 \fB\fB/proc/*\fR\fR
967 .RS 19n
968 process files
972 .ne 2
974 \fB\fB/usr/proc/lib/*\fR\fR
976 .RS 19n
977 \fBproc\fR tools supporting files
980 .SH ATTRIBUTES
982 See \fBattributes\fR(5) for descriptions of the following attributes:
987 box;
988 c | c
989 l | l .
990 ATTRIBUTE TYPE  ATTRIBUTE VALUE
992 Interface Stability     See below.
997 The command syntax is Evolving. The \fB-L\fR option and the output formats are
998 Unstable.
999 .SH SEE ALSO
1001 \fBldd\fR(1), \fBlgrpinfo\fR(1), \fBmadv.so.1\fR(1), \fBmdb\fR(1),
1002 \fBplgrp\fR(1), \fBpmadvise\fR(1), \fBproc\fR(1), \fBps\fR(1),
1003 \fBcoreadm\fR(8), \fBprstat\fR(8), \fBswap\fR(8), \fBmmap\fR(2),
1004 \fBmemcntl\fR(2), \fBmeminfo\fR(2), \fBshmop\fR(2), \fBdlopen\fR(3C),
1005 \fBproc\fR(4), \fBattributes\fR(5)