Page 1 of 1

Running out of RAM when compiling on Ubuntu

Posted: 10 Nov 2021, 10:42
by ZivaU
I use Ubuntu 20.4 and have 8GB of RAM. I first installed polymake using `sudo apt install polymake`. When re-compiling my computer freezes and I managed to figure out that it runs out of RAM (when I am not running anything it uses approximately 1GB). I then tried uninstalling polymake and installing again from source (following the instructions at https://polymake.org/doku.php/install/install), but ran into the same problem.

Is there anything I can do to avoid this?

Re: Running out of RAM when compiling on Ubuntu

Posted: 10 Nov 2021, 23:29
by gawrilow
When you install an official package via apt, there should be no need in recompilation, everything is ready to use. What exactly were you trying to do that caused the compilation?

Re: Running out of RAM when compiling on Ubuntu

Posted: 11 Nov 2021, 11:55
by ZivaU
Thank you for a prompt response!

I used it for some computations, closed it and opened it again (this would be my second use of it). That caused it to recompile.

Re: Running out of RAM when compiling on Ubuntu

Posted: 11 Nov 2021, 13:20
by gawrilow
After your first session, a directory structure named ~/.polymake/wrappers.0 or similar should have appeared in your home directory. How many files with a suffix ".cpperl" are there in total? Use the `find` command to list them all, they reside in deeper subdirectories. If there are just one or two, then it's a bad news: your computer is simply too small for polymake :oops: or you have too many other processes running in parallel (watching videos?). But if there are in fact many such files, you can help yourself with a small hack: create a simple script file

#!/bin/bash
/usr/bin/ninja -j 1 "$@"

Store this script under the name "ninja" in any directory which occurs in your PATH before /usr/bin, and set the executable bit (chmod u+x ninja). Then it will start only one compilation job at any time, hopefully it will nicely fit in your RAM.