From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078609810722.tru64-unix-managers.marc@archive.invalid> From: David Gadbois Date: Sat, 29 Mar 1997 20:05:46 +0000 To: tru64-unix-managers Subject: Virtual memory parameters X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078609810722 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