In the interest of more easily identifying and fixing ports that exhaust the 
system's memory while building, with the consequence that builds stall and time 
out or that the OS crashes, like these:

https://trac.macports.org/ticket/73569
https://trac.macports.org/ticket/73057
https://trac.macports.org/ticket/72954
https://trac.macports.org/ticket/72933
https://trac.macports.org/ticket/72931
https://trac.macports.org/ticket/72847
https://trac.macports.org/ticket/65560

I propose to modify our buildbot and CI setups so that while a build is 
happening, we periodically check the memory usage of all child processes and 
keep track of the n largest ones. 

At the end of the build, this information could be visualized as a graph 
showing top memory usage over time or just a list of the largest processes.

These results can be attached to the buildbot or CI run for easy access. If the 
largest memory usage exceeds the port's declared `build.mem_per_job`, this can 
be marked in some easily-seen way. For example, on buildbot, we could add 
another build step and set its status to success (green) if memory usage stayed 
within declared limits or warning (orange) if not. 

I have begun writing a standalone tool to do this memory usage measurement. Or 
it could be built into MacPorts. 


Reply via email to