Running out of RAM when compiling on Ubuntu

Questions and problems about using polymake go here.
ZivaU
Posts: 2
Joined: 10 Nov 2021, 10:27

Running out of RAM when compiling on Ubuntu

Postby ZivaU » 10 Nov 2021, 10:42

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?

User avatar
gawrilow
Main Author
Posts: 425
Joined: 25 Dec 2010, 17:40

Re: Running out of RAM when compiling on Ubuntu

Postby gawrilow » 10 Nov 2021, 23:29

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?

ZivaU
Posts: 2
Joined: 10 Nov 2021, 10:27

Re: Running out of RAM when compiling on Ubuntu

Postby ZivaU » 11 Nov 2021, 11:55

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.

User avatar
gawrilow
Main Author
Posts: 425
Joined: 25 Dec 2010, 17:40

Re: Running out of RAM when compiling on Ubuntu

Postby gawrilow » 11 Nov 2021, 13:20

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.


Return to “Helpdesk”