You are not logged in.

#1 2013-06-03 16:50:52

ravicious
Member
From: Poland
Registered: 2011-06-07
Posts: 69
Website

Virtual memory exhausted when compiling packages from AUR

Recently I've seen this error more and more often. When I tried compiling some packages from AUR, I ended up getting "virtual memory exhausted" error. The first time it happened with clementine-git, then android-studio. Can I do something about it?

Offline

#2 2013-06-03 16:54:55

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Virtual memory exhausted when compiling packages from AUR

How exactly are you compiling these packages - using makepkg?

Offline

#3 2013-06-03 17:01:33

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: Virtual memory exhausted when compiling packages from AUR

are you using an aur helper? most aur helper compile using tmpfs by default so you can run out of ram compiling stuff, change it to compile on your hdd instead.

Offline

#4 2013-06-03 17:05:46

ravicious
Member
From: Poland
Registered: 2011-06-07
Posts: 69
Website

Re: Virtual memory exhausted when compiling packages from AUR

I use packer, so I guess it uses make or makpkg.

@bwat47, thanks. How do I make them to do that? By changing the build directory?

Last edited by ravicious (2013-06-03 17:12:46)

Offline

#5 2013-06-03 17:12:25

bwat47
Member
Registered: 2009-10-07
Posts: 638

Re: Virtual memory exhausted when compiling packages from AUR

ravicious wrote:

I use packer, so I guess it uses make or makpkg.

@bwat47, thanks, I'll look into it.

yeah by default packer and most other aur helpers use the /tmp dir for compiling. By default in arch /tmp is mounted in ram using tmpfs, so when compiling you are limited to the amount of ram. Packer probably has an option to change the compiling dir.

Offline

#6 2013-06-03 17:19:42

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Virtual memory exhausted when compiling packages from AUR

man packer wrote:

Packages are built in the TMPDIR path. If the TMPDIR variable is not set then the default path is /tmp

Offline

#7 2013-06-03 18:29:04

ravicious
Member
From: Poland
Registered: 2011-06-07
Posts: 69
Website

Re: Virtual memory exhausted when compiling packages from AUR

Hmm, even though I set TMPDIR to /usr/local/src (and packer actually uses this dir), the problem still exist.

Offline

#8 2013-06-03 18:30:26

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Virtual memory exhausted when compiling packages from AUR

Do you have any swap space? If you're low on ram with no or very little swap, you can have problems, too.

And stop using packer! When you have a problem, always try it with makepkg first to see if that fixes it.

Last edited by Scimmia (2013-06-03 18:30:59)

Offline

#9 2013-06-03 19:15:13

ravicious
Member
From: Poland
Registered: 2011-06-07
Posts: 69
Website

Re: Virtual memory exhausted when compiling packages from AUR

I have 3 GB of RAM and no swap space at all. I tried to compile clementine-git without using packer, just with makepkg and it thrown an "virtual memory exhausted" error, too.

Offline

#10 2013-06-03 19:17:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 13,729

Re: Virtual memory exhausted when compiling packages from AUR

Add a swap file, I'll bet the problem goes away.

Offline

#11 2013-06-06 17:04:11

ravicious
Member
From: Poland
Registered: 2011-06-07
Posts: 69
Website

Re: Virtual memory exhausted when compiling packages from AUR

You're right. I made a 1,5 GB swapfile and it worked, thanks!

I followed wiki and changed vm.swappiness and vm.vfs_cache_pressure values. What's strange is that usually there would be like 90% of RAM used, now during compilation it was like 60% of RAM and 9% of swap.

Last edited by ravicious (2013-06-06 19:08:34)

Offline

#12 2013-06-06 20:12:41

Kalrish
Member
Registered: 2013-02-27
Posts: 62

Re: Virtual memory exhausted when compiling packages from AUR

ravicious wrote:

I followed wiki and changed vm.swappiness and vm.vfs_cache_pressure values. What's strange is that usually there would be like 90% of RAM used, now during compilation it was like 60% of RAM and 9% of swap.

It may be due to a heavy program that run and took a lot of memory (i.e. the linker), so other processes executing in parallel had to use swap. When the heavy program exited, a huge amount of RAM was freed, but the other programs were still having much of their memory in swap. And it was then that you run free, might that be possible? RAM usage should be meticulously monitored.

I'm sorry for my English, and also for the terminology. If the example explained above is not your case, try reverting back the values, or put another ones. In any case, RAM usage is too trivial.

Offline

#13 2014-11-27 16:18:01

dufferdev
Member
Registered: 2014-11-27
Posts: 1

Re: Virtual memory exhausted when compiling packages from AUR

I am also facing the same problem.  I am trying to install a package, and the installations aborts saying 'virtual memory exhausted'. The RAM is 2 GB and i have alloted 2 GB as swap.  Things i have tried so far
-install  using yaourt
-install using  makepkg.
-change  TMPDIR to HDD.

Even when i tried it without any window manager to start, limiting the RAM usage, the problem still persists. The only way is to allot an extra swap space, but that would mean that i will have to delete a partition, which is not a feasible solution. Is there anything else one could do. ?

if it helps,

ulimit -a
core file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 20
file size               (blocks, -f) unlimited
pending signals                 (-i) 16033
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) 16033
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited

Offline

Board footer

Powered by FluxBB