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

NAME

6       ppgsz - set preferred page size for stack, heap, and/or other anonymous
7       segments
8

SYNOPSIS

10       /usr/bin/ppgsz [-F] -o option[,option] cmd | -p pid...
11
12

DESCRIPTION

14       The ppgsz utility sets the preferred page size for stack, heap,  and/or
15       other  anonymous  segments  for  the  target  process(es), that is, the
16       launched cmd or the process(es) in the pid list. ppgsz stops the target
17       process(es) while changing the page size. See memcntl(2).
18

OPTIONS

20       The following options are supported:
21
22       -F                    Force.  Sets  the  preferred page size options(s)
23                             for target  process(es)  even  if  controlled  by
24                             other  process(es).  Caution  should be exercised
25                             when using the -F flag. See proc(1).
26
27
28       -o option[,option]    The options are:
29
30                             heap=size     This option specifies the preferred
31                                           page  size for the heap of the tar‐
32                                           get process(es). heap is defined to
33                                           be the bss (uninitialized data) and
34                                           the brk area that immediately  fol‐
35                                           lows the bss (see brk(2)). The pre‐
36                                           ferred heap page size  is  set  for
37                                           the existing heap and for any addi‐
38                                           tional heap memory allocated in the
39                                           future. See NOTES.
40
41
42                             stack=size    This option specifies the preferred
43                                           page size for the stack of the tar‐
44                                           get   process(es).   The  preferred
45                                           stack page  size  is  set  for  the
46                                           existing  stack and newly allocated
47                                           parts of the stack as it expands.
48
49
50                             anon=size     This option specifies the preferred
51                                           page size for all existing MAP_PRI‐
52                                           VATE anonymous segments of the tar‐
53                                           get  process(es),   other than heap
54                                           and stack, which are  large  enough
55                                           to fit at least one aligned page of
56                                           the specified size.  For  the  seg‐
57                                           ments  that  are  large enough, the
58                                           preferred page size is set starting
59                                           at  the  first size-aligned address
60                                           in the segment. The anon  preferred
61                                           pagesize is not applied to MAP_PRI‐
62                                           VATE anonymous segments created  in
63                                           the   future.   See   MAP_ANON   in
64                                           mmap(2).
65
66                                           Anonymous memory refers to MAP_PRI‐
67                                           VATE  pages  that  are not directly
68                                           associated  with  a  file  in  some
69                                           filesystem.  The ppgsz command uses
70                                           memcntl(2)  to  set  the  preferred
71                                           page  size  for anonymous segments.
72                                           See MC_HAT_ADVISE in memcntl(2).
73
74                             At least one of the above options must be  speci‐
75                             fied.
76
77                             size  must  be  a  supported page size (see page‐
78                             size(1)) or 0, in  which  case  the  system  will
79                             select an appropriate page size. See memcntl(2).
80
81                             size  defaults  to  bytes and can be specified in
82                             octal (0),  decimal,  or  hexadecimal  (0x).  The
83                             numeric value can be qualified with K, M, G, or T
84                             to specify Kilobytes,  Megabytes,  Gigabytes,  or
85                             Terabytes,   respectively.   4194304,   0x400000,
86                             4096K, 0x1000K, and  4M  are  different  ways  to
87                             specify 4 Megabytes.
88
89
90       -p pid                Sets  the  preferred  page size option(s) for the
91                             target process(es) in the process-id  (pid)  list
92                             following  the  -p  option. The pid list can also
93                             consist of names in the /proc directory. Only the
94                             process  owner  or the super-user is permitted to
95                             set page size.
96
97                             cmd is interpreted if -p is not specified.  ppgsz
98                             launches  cmd  and applies page size option(s) to
99                             the new process.
100
101                             The heap  and  stack  preferred  page  sizes  are
102                             inherited.   Child   process(es)   created   (see
103                             fork(2)) from the launched process or the  target
104                             process(es) in the pid list after ppgsz completes
105                             will inherit the preferred heap  and  stack  page
106                             sizes.  The  preferred page sizes of all segments
107                             are set back to the default system page  size  on
108                             exec(2) (see getpagesize(3C)). The preferred page
109                             size for all  other  anonymous  segments  is  not
110                             inherited  by  children of the launched or target
111                             process(es).
112
113

EXAMPLES

115       Example 1 Setting the preferred heap and stack page size
116
117
118       The following example sets the preferred heap page size to 4M  and  the
119       preferred  stack  page size to 512K for all ora—owned processes running
120       commands that begin with ora:
121
122
123         example% ppgsz -o heap=4M,stack=512K -p `pgrep -u ora '^ora'`
124
125
126
127       Example 2 Setting the preferred anonymous page size
128
129
130       The following example sets the preferred page size of existing qualify‐
131       ing anonymous segments to 512k for process ID 953:
132
133
134         example% ppgsz -o anon=512k -p 953
135
136
137

EXIT STATUS

139       If  cmd  is  specified and successfully invoked (see exec(2)), the exit
140       status of ppgsz will be the exit status of cmd. Otherwise,  ppgsz  will
141       exit with one of the following values:
142
143       0      Successfully set preferred page size(s) for processes in the pid
144              list.
145
146
147       125    An error occurred in ppgsz. Errors  include:  invalid  argument,
148                 invalid  page size(s) specified, and failure to set preferred
149              page size(s) for one or more processes in the pid list or cmd.
150
151
152       126    cmd was found but could not be invoked.
153
154
155       127    cmd could not be found.
156
157

FILES

159       /proc/*                      Process files.
160
161
162       /usr/lib/ld/map.bssalign     A template link-editor mapfile for  align‐
163                                    ing bss (see NOTES).
164
165

ATTRIBUTES

167       See attributes(5) for descriptions of the following attributes:
168
169
170
171
172       ┌─────────────────────────────┬─────────────────────────────┐
173       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
174       ├─────────────────────────────┼─────────────────────────────┤
175       │Availability                 │SUNWesu (32-bit)             │
176       │                             │SUNWesxu (64-bit)            │
177       ├─────────────────────────────┼─────────────────────────────┤
178       │Interface Stability          │Evolving                     │
179       └─────────────────────────────┴─────────────────────────────┘
180

SEE ALSO

182       ld(1),  mpss.so.1(1),  pagesize(1), pgrep(1), pmap(1), proc(1), brk(2),
183       exec(2),  fork(2),  memcntl(2),  mmap(2),   sbrk(2),   getpagesize(3C),
184       proc(4), attributes(5)
185
186
187       Linker and Libraries Guide
188

NOTES

190       Due  to  resource  constraints,  the setting of the preferred page size
191       does not necessarily guarantee that the target process(es) will get the
192       preferred page size. Use pmap(1) to view the actual heap and stack page
193       sizes of the target process(es) (see pmap -s option).
194
195
196       Large pages are required to be mapped at addresses that  are  multiples
197       of  the  size  of  the large page. Given that the heap is typically not
198       large page aligned, the starting portions of the heap (below the  first
199       large  page  aligned  address)  are  mapped with the system memory page
200       size. See getpagesize(3C).
201
202
203       To provide a heap that will be mapped with a large page size, an appli‐
204       cation  can be built using a link-editor (ld(1)) mapfile containing the
205       bss segment declaration directive. Refer to the section Mapfile  Option
206       in  the  Linker  and Libraries Guide for more details of this directive
207       and the template mapfile provided  in  /usr/lib/ld/map.bssalign.  Users
208       are  cautioned  that an alignment specification may be machine-specific
209       and may lose its benefit on different hardware platforms. A more flexi‐
210       ble  means  of  requesting  the  most  optimal underlying page size may
211       evolve in future releases.
212
213
214       mpss.so.1(1), a preloadable shared object, can also be used to set  the
215       preferred stack and/or heap page sizes.
216
217
218
219SunOS 5.11                        23 Jan 2003                         ppgsz(1)
Impressum