Even with single-package-installs, emerge consumes ~200MB of RSS. World update then needs ~600MB. This memory is also never released and occupies memory until emerge dies. My laptop has "only" 8GB of memory and during compilation every MB counts. Reproducible: Always Steps to Reproduce: 1. emerge some/package OR emerge -uDN @world 2. observe memory usage 3. Expected Results: I'd like to see a big drop in emerge's memory usage as soon as installation begins Portage 2.2.18 (python 2.7.9-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.2, glibc-2.20-r2, 3.18.13-gentoo x86_64)
*** Bug 549908 has been marked as a duplicate of this bug. ***
It already attempts to free as much memory as possible. However, the objects that it doesn't free can be spread across many different pools within the heap, preventing python from freeing lots of pools that are only partially consumed. One way to solve this issue would be to do the dependency calculation in a short-lived child process, and then serialize the result of the calculation for use by a longer-lived process.