Memory and Thread Placement Optimization Developer's Guide
Previous Next

The pmadvise utility

The pmadvise utility applies rules to a process that define how that process uses memory. The pmadvise utility applies the rules, called advice, to the process with the madvise(3C) tool. This tool can apply advice to a specific subrange of locations in memory at a specific time. By contrast, the madv.so.1(1) tool applies the advice throughout the execution of the target program to all segments of a specified type.

The pmadvise utility has the following options:

-f

This option takes control of the target process. This option overrides the control of any other process. See the proc(1) manual page.

-o

This option specifies the advice to apply to the target process. Specify the advice in this format:

private=advice
shared=advice
heap=advice
stack=advice
address:length=advice

The value of the advice term can be one of the following:

normal
random
sequential
willneed
dontneed
free
access_lwp
access_many
access_default

You can specify an address and length to specify the subrange where the advice applies. Specify the address in hexadecimal notation and the length in bytes.

If you do not specify the length and the starting address refers to the start of a segment, the pmadvise utility applies the advice to that segment. You can qualify the length by adding the letters K, M, G, T, P, or E to specify kilobytes, megabytes, gigabytes, terabytes, or exabytes, respectively.

-v

This option prints verbose output in the style of the pmap(1) tool that shows the value and locations of the advice rules currently in force.

The pmadvise tool attempts to process all legal options. When the pmadvise tool attempts to process an option that specifies an illegal address range, the tool prints an error message and skips that option. When the pmadvise tool finds a syntax error, it quits without processing any options and prints a usage message.

When the advice for a specific region conflicts with the advice for a more general region, the advice for the more specific region takes precedence. Advice that specifies a particular address range has precedence over advice for the heap and stack regions, and advice for the heap and stack regions has precedence over advice for private and shared memory.

The advice rules in each of the following groups are mutually exclusive from other advice rules within the same group:

MADV_NORMAL, MADV_RANDOM, MADV_SEQUENTIAL
MADV_WILLNEED, MADV_DONTNEED, MADV_FREE   
MADV_ACCESS_DEFAULT, MADV_ACCESS_LWP, MADV_ACCESS_MANY
Previous Next