[MacPorts] #29547: enblend build uses extraordinary amounts of memory

MacPorts noreply at macports.org
Sun May 22 11:36:43 PDT 2011


#29547: enblend build uses extraordinary amounts of memory
-------------------------------------+--------------------------------------
 Reporter:  ryandesign@…             |       Owner:  hvdwolf@…        
     Type:  enhancement              |      Status:  new              
 Priority:  Normal                   |   Milestone:                   
Component:  ports                    |     Version:  1.9.2            
 Keywords:                           |        Port:  enblend          
-------------------------------------+--------------------------------------
 System specifications:

  * MacBookPro3,1
  * 2.2-GHz Core 2 Duo
  * 6 GB RAM
  * Mac OS X 10.6.7

 Building the enblend port with the default 2 parallel make jobs slows my
 computer to a crawl and makes it unresponsive for minutes at a time. The
 problem is not high CPU usage; high CPU usage does not usually slow down
 my machine, and in fact CPU usage is low during the problem. The problem
 is that the build sucks up so much memory that
 [http://en.wikipedia.org/wiki/Thrashing_(computer_science) thrashing]
 occurs. I end up having to cancel the build (once I can briefly regain
 control of the machine) and restart it with fewer jobs, i.e.:
 {{{
 sudo port install enblend build.jobs=1
 }}}

 MacPorts parallel building code computes how many jobs to start based on
 the number of processor cores, or the number of GB of installed memory,
 whichever is less; on my 2-core Mac with 6 GB memory, that means 2 jobs
 get started. But while the MacPorts estimate of 1 GB per job was meant to
 be overly conservative, enblend's build can make each compile job take up
 to 2 GB of real memory (as observed in Activity Monitor).

 A simple solution would be to disable parallel building entirely for
 enblend by adding the line:
 {{{
 use_parallel_build no
 }}}
 enblend does take a while to build, and allowing parallel builds on
 machines that have enough memory to support it would be nice, so a more
 complicated solution could be to have the portfile set build.jobs to a new
 computed number based on number of cores and amount of RAM, using a
 different formula than MacPorts base. For example, instead of 1 job per 1
 GB installed RAM it could be 1 job per 4 GB installed RAM. Code to
 implement this might be adapted from that in MacPorts base. Or perhaps
 instead of basing the calculation on installed RAM it could be based on
 free RAM; if that value is ascertainable.

 I see that the portfile for hugin-app, which uses enblend, also turns off
 parallel building, though I'm not sure if this is for the same reason. I
 see that hugin-app uses a lot of memory to build too, but not as much as
 enblend (< 1 GB per compile job).

 Yes, my 6-GB Mac might be able to sustain the 2-job enblend parallel build
 if nothing else were running, but that's not likely to be the case: I
 don't have 6 GB RAM installed to keep it empty; I have it installed
 because I run programs that use it.

-- 
Ticket URL: <https://trac.macports.org/ticket/29547>
MacPorts <http://www.macports.org/>
Ports system for Mac OS


More information about the macports-tickets mailing list