Re: bitbake controlling memory use
I think you write a script to do all the WATCH-STOP-CONTINUE stuff.
memwatch bitbake core-image-minimal
Options could be added.
memwatch --interval 5 --logfile test.log bitbake core-image-minimal
This script first becomes a session leader, then forks to start the 'bitbake' command as its child process.
Then, every several seconds (say 10s by default), it checks the current memory usage, and according to its policy, determines whether to stop/continue some process or not.
For stopping the process, you can first get all its child process by simply using the 'ps' command.
$ ps o vsize,comm,pid -s 28303 | sort -n -r
317284 emacs 12883
28912 ps 36302
26248 sort 36303
21432 man 24797
17992 bash 28303
9852 pager 24807
VSZ COMMAND PID
Then skip the bitbake processes, stop the first one that uses the largest memory, record its PID.
For continuing processes, just start it according to the records. Maybe using FILO by default?
On 04/11/2021 11:23 PM, Gmane Admin wrote:
My build machine has 8 cores + HT so bitbake enthusiastically assumes 16. However I have (only?) 16GB of RAM (+24GB swap space).