Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 549906

Summary: emerge should free up some memory before starting compilation
Product: Portage Development Reporter: . <dev.rindeal+gentoo>
Component: CoreAssignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: alex_y_xu, kingjon3377, tdalman
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 240320    

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
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)
Comment 1 Brian Evans (RETIRED) 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.