1pmadvise(1)                      User Commands                     pmadvise(1)
2
3
4

NAME

6       pmadvise - applies advice about memory to a process
7

SYNOPSIS

9       pmadvise -o option[,option] [-F] [-l] [-v] pid...
10
11

DESCRIPTION

13       pmadvise  applies  advice  about  how  memory  is used in the specified
14       process using madvise(3C).
15
16
17       pmadvise allows users to apply advice to a specific sub-range at a spe‐
18       cific  instant  in  time.  pmadvise  differs  from madv.so.1(1) in that
19       madv.so.1(1) applies the advice throughout execution of the target pro‐
20       gram to all segments of a specified type.
21

OPTIONS

23       The following options are supported:
24
25       -F    Force  by grabbing the target process even if another process has
26             control.
27
28             You should  exercise  caution  when  using  the  -F  option.  See
29             proc(1).
30
31
32       -l    Show unresolved dynamic linker map names.
33
34
35       -o    Specify advice to apply in the following form:
36
37               private=advice
38               shared=advice
39               heap=advice
40               stack=advice
41               address[:length]=advice
42
43
44             where the advice can be one of the following:
45
46               normal
47               random
48               sequential
49               willneed
50               dontneed
51               free
52               access_lwp
53               access_many
54               access_default
55
56
57             An address and length can be given to specify a subrange to apply
58             the advice.The address  should  be  hexadecimal  and  the  length
59             should be in bytes by default.
60
61             If length is not specified and the starting address refers to the
62             start of a segment, the advice is applied to that segment. length
63             can  be  qualified  by  K, M, G, T, P, or E to specify kilobytes,
64             megabytes, gigabytes, terabytes, or exabytes respectively as  the
65             unit of measure.
66
67
68       -v    Print  verbose  output.  Display  output as pmap(1) does, showing
69             what advice is being applied where. This can be useful  when  the
70             advice  is being applied to a named region (for example, private,
71             shared, and so forth) to get feedback on exactly where the advice
72             is being applied.
73
74
75
76       pmadvise  tries  to  process  all  legal options. If an illegal address
77       range is specified, an error  message  is  printed  and  the  offending
78       option  is  skipped.  pmadvise quits without processing any options and
79       prints a usage message when there is a syntax error.
80
81
82       If conflicting advice is given on a region, the order of precedence  is
83       from  most  specific  advice  to least, that is, most general. In other
84       words, advice specified for a particuliar address  range  takes  prece‐
85       dence  over  advice  for  heap and stack which in turn takes precedence
86       over advice for private and shared memory.
87
88
89       Moreover, the advice in each  of  the  following  groups  are  mutually
90       exclusive from the other advice within the same group:
91
92         MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL
93         MADV_WILLNEED, MADV_DONTNEED, MADV_FREE
94         MADV_ACCESS_DEFAULT, MADV_ACCESS_LWP, MADV_ACCESS_MANY
95
96
97

OPERANDS

99       The following operands are supported:
100
101       pid    Process ID.
102
103

EXAMPLES

105       Example 1 Applying Advice to a Segment at Specified Address
106
107
108       The  following  example  applies  advice  to  a  segment at a specified
109       address:
110
111
112         % pmap $$
113         100666: tcsh
114         00010000     312K r-x--  /usr/bin/tcsh
115         0006C000      48K rwx--  /usr/bin/tcsh
116         00078000     536K rwx--    [ heap ]
117         FF100000     856K r-x--  /lib/libc.so.1
118         FF1E6000      32K rwx--  /lib/libc.so.1
119         FF1EE000       8K rwx--  /lib/libc.so.1
120         FF230000     168K r-x--  /lib/libcurses.so.1
121         FF26A000      32K rwx--  /lib/libcurses.so.1
122         FF272000       8K rwx--  /lib/libcurses.so.1
123         FF280000     576K r-x--  /lib/libnsl.so.1
124         FF310000      40K rwx--  /lib/libnsl.so.1
125         FF31A000      24K rwx--  /lib/libnsl.so.1
126         FF364000       8K rwxs-    [ anon ]
127         FF370000      48K r-x--  /lib/libsocket.so.1
128         FF38C000       8K rwx--  /lib/libsocket.so.1
129         FF3A0000       8K r-x--  /platform/sun4u-us3/lib/libc_psr.so.1
130         FF3B0000     176K r-x--  /lib/ld.so.1
131         FF3EC000       8K rwx--  /lib/ld.so.1
132         FF3EE000       8K rwx--  /lib/ld.so.1
133         FFBE6000     104K rw---    [ stack ]
134         %
135         % pmadvise -o 78000=access_lwp $$
136
137         %
138
139
140
141       Example 2 Using the -v Option
142
143
144       The following example displays verbose output from pmadvise:
145
146
147
148         % pmadvise -o heap=access_lwp,stack=access_default -v $$
149         1720:   -sh
150         00010000      88K r-x--  /sbin/sh
151         00036000       8K rwx--  /sbin/sh
152         00038000      16K rwx--    [ heap ]           <= access_lwp
153         FF250000      24K r-x--  /lib/libgen.so.1
154         FF266000       8K rwx--  /lib/libgen.so.1
155         FF272000       8K rwxs-    [ anon ]
156         FF280000     840K r-x--  /lib/libc.so.1
157         FF362000      32K rwx--  /lib/libc.so.1
158         FF36A000      16K rwx--  /lib/libc.so.1
159         FF380000       8K r-x--  /platform/sun4u-us3/lib/libc_psr.so.1
160         FF390000      64K rwx--    [ anon ]
161         FF3B0000     168K r-x--  /lib/ld.so.1
162         FF3EA000       8K rwx--  /lib/ld.so.1
163         FF3EC000       8K rwx--  /lib/ld.so.1
164         FFBFE000       8K rw---    [ stack ]          <= access_default
165
166
167

EXIT STATUS

169       The following exit values are returned:
170
171       0           Successful completion.
172
173
174       non-zero    An error occurred.
175
176

FILES

178       /proc/*            Process files
179
180
181       /usr/prob/lib/*    proc tools support files
182
183

ATTRIBUTES

185       See attributes(5) for descriptions of the following attributes:
186
187
188
189
190       ┌─────────────────────────────┬─────────────────────────────┐
191       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
192       ├─────────────────────────────┼─────────────────────────────┤
193       │Availability                 │SUNWesu                      │
194       ├─────────────────────────────┼─────────────────────────────┤
195       │Interface Stability          │See below.                   │
196       └─────────────────────────────┴─────────────────────────────┘
197
198
199       The command syntax is Evolving. The output formats are Unstable.
200

SEE ALSO

202       madv.so.1(1), pmap(1), proc(1), madvise(3C), attributes(5)
203
204
205
206SunOS 5.11                        25 Sep 2008                      pmadvise(1)
Impressum