User: Password:
|
|
Subscribe / Log in / New account

Go's memory management, ulimit -v, and RSS control

Go's memory management, ulimit -v, and RSS control

Posted Feb 18, 2011 4:21 UTC (Fri) by cmccabe (guest, #60281)
Parent article: Go's memory management, ulimit -v, and RSS control

Hmm. When the program is started, can't you just call getrlimit to find out the RLIMIT_AS limit is? Then, if that is less than 16 GB, allocate only that amount of pages rather than the full 16 GB.

Of course, if that's *all* you do, you can't get any more pages by other means, such as mmap.

I guess you can work around that too. Whenever you are about to call mmap, first reduce your original reservation by the size of the reservation you're about to make using mremap(MREMAP_FIXED).

Does this work, or am I missing something?


(Log in to post comments)


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds