blob: 7d85bc5ebe7f223b9d33ecebd73a4e1e3e13cd20 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
.help zawset May84 "System Interface"
.ih
NAME
zawset -- adjust working set size
.ih
SYNOPSIS
.nf
zawset (requested_size, newsize, oldsize, textsize)
int requested_size # desired working set size, bytes
int newsize # working set allocated, bytes
int oldsize # old working set size, bytes
int textsize # size of text segment
.fi
.ih
DESCRIPTION
Adjust the amount of physical memory allocated to a process, i.e., the
working set size on a virtual memory machine. The amount of additional
data space that can be allocated and used by a process without thrashing
on a virtual memory machine is \fInewsize\fR bytes minus some fraction
of the text segment size (executable instructions) and minus the data space
already in use.
The actual working set size returned in \fInewsize\fR need not be what was
requested. The old working set size \fIoldsize\fR may be used to reset the
working set size of the process to its original value when the space is no
longer needed. If \fIrequested_size\fR is negative or zero the current size is
returned in both output arguments and the working set size is not changed.
On a nonvirtual memory machine the "working set size" is a machine constant
fixed by the addressing range of the hardware, hence the requested size is
ignored.
.ih
RETURN VALUE
Valid \fInewsize\fR, \fIoldsize\fR and \fBtextsize\fR are always returned.
.ih
NOTES
It is up to the high level code to supply the necessary heuristics to avoid
thrashing on a virtual memory machine.
.ih
SEE ALSO
zmalloc, zmfree, zraloc
.endhelp
|