Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 549906 - emerge should free up some memory before starting compilation
Summary: emerge should free up some memory before starting compilation
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Portage team
: 549908 (view as bug list)
Depends on:
Blocks: 240320
  Show dependency tree
Reported: 2015-05-19 16:10 UTC by .
Modified: 2020-12-13 15:16 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Note You need to log in before you can comment on or make changes to this bug.
Description . 2015-05-19 16:10:17 UTC
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

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)
Comment 1 Brian Evans Gentoo Infrastructure gentoo-dev 2015-05-19 16:16:40 UTC
*** Bug 549908 has been marked as a duplicate of this bug. ***
Comment 2 Zac Medico gentoo-dev 2015-06-06 21:36:05 UTC
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.