Virtual memory parameters

From: David Gadbois <gadbois_at_cyc.com>
Date: Sat, 29 Mar 1997 14:05:46 -0600 (CST)

I have an application that allocates and deallocates memory in 64KB
regions out of an 8GB address space arena. It uses mmap() to allocate
these regions, and munmap() to return them when it is done with them.
The relevant kernel parameters I have modified to allow for this are:

vm:
vm-maxvas = 8589934592
vm-vpagemax = 16384

proc:
max-per-proc-address-space = 8589934592

Allocating memory usually works fine. However, sometimes munmap()
returns EINVAL, which the man page says indicates "The addr parameter
is not a multiple of the page size as returned by
sysconf(_SC_PAGE_SIZE)." This is certainly not the case, since the
regions returned are always multiples of 64KB. The failure would not
be so bad, but later attempts to mmap() parts of the arena that the OS
failed to take back fail themselves, and the unreturned regions appear
to also remain accounted against the address space limit. The
application eventually (it takes a long time to run through 8GB) fails
when it can no longer allocate memory.

I suspect that the problem has something to do with vm-vpagemax. I
understand that the parameter has something to do with the number of
changes in address space page protections allowed. Is there some
other parameter that needs to be tweaked in order for this scheme to
work?

I have been seeing this problem in OSF/1 V3.0 347, and have been leery
of upgrading to version 4 for fear things might get worse. Does
version 4 have any relevant fixes?

Thanks,
--David Gadbois
Received on Sat Mar 29 1997 - 21:20:02 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:36 NZDT