On 2022-09-17 17:37+0800 johnstrass <johnstr...@163.com> wrote: > At 2022-09-17 14:15:51, "Walter Dnes" <waltd...@waltdnes.org> wrote: > > >On Sat, Sep 17, 2022 at 10:40:53AM +0800, johnstrass wrote > > > >> Compiling gcc uses alot of memory, sometimes only less then 10MB > >> left free ( I am doing this on a small yeeloong netbook with only > >> 1GB memory). > > > > Ouch, I'm surprised it compiles at all. The Gentoo install > > handbook > >https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation#MAKEOPTS > >has a dire warning about memory usage... > > > > > > > Yep, I've got the gcc-12.2.0 natively compiled on this netbook using > gcc-11.3.0, after 5+ days + a crash + 5more days. > > I set up a large swap and I've also set up the ccache which may > speedup a little after the crash. > > > >> Warning > >> Using a large number of jobs can significantly impact memory > >> consumption. A good recommendation is to have at least 2 GiB of RAM > >> for every job specified (so, e.g. -j6 requires at least 12 GiB). To > >> avoid running out of memory, lower the number of jobs to fit the > >> available memory. > > > > You simply don't have enough ram. You might reduce the pain and > > the > >swapping by trying something like the following in make.conf > >(assuming you haven't already done it) > > > > >MAKEOPTS="-j1" > > > I will try next time. Thanks. > > > > > >> If this happens, what is the best way to reboot or shutdown? > > > > > Try ye olde {CTRL}{ALT}{DEL} > > > > > I remember that I did try "CTRL+ALT+DEL" in such situations before, > and most times it did not work but for one or two times it worked > occasionally. I will try it again next time.
You could also use “Magic SysRQ”s[1] to reboot the system forcefully but somewhat controlled. The traditional sequence is: r e i s u b (raising elephants is so utterly boring)[2] [1] <https://wiki.gentoo.org/wiki/Magic_SysRQ> [2] <https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html#what-are-the-command-keys>