I want to compile mysql-workbench but run into memory issues. My laptop has 2 GB of RAM. 64 GB SSD with one ext4 partition. I created a 2 GB swapfile on /.
This is df -lh
rootfs 59G 12G 45G 21% / dev 959M 0 959M 0% /dev run 970M 636K 969M 1% /run /dev/sda1 59G 12G 45G 21% / tmpfs 970M 628K 969M 1% /dev/shm tmpfs 970M 0 970M 0% /sys/fs/cgroup tmpfs 970M 16K 970M 1% /tmp
RAM keeps filling up from 500 MB to 1.1 GB then falls back to 500 MB. When reaching 1.2 GB it swaps some MB into the swapfile. Swappiness is at 30. That goes one for over a hour untill the build fails with some out of memory messages.
I looked into df -lh again and saw that /tmp was maxed out at 100%.
This is /etc/fstab:
# # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> tmpfs /tmp tmpfs nodev,nosuid 0 0 /swapfile none swap defaults 0 0 # UUID=2985462a-ac9c-48de-8bbf-0bbb83a4b4f3 /dev/sda1 / ext4 rw,relatime,data=ordered 0 1
I read the wiki that /tmp can be increased to more than 50% of physical memory with the size option but I'm not sure if that is a good idea.
Anyone has some ideas that would help me out?
Last edited by blackout23 (2013-01-17 20:59:05)
Are you using packer or somesuch? packer by default uses /tmp for building packages. If you compile outside of /tmp, files used while compiling won't be forcefully kept in your memory.
I simply let the PKGBUILD do it's thing. Compiling it via AUR. Really not sure what tools and parameters it uses. I did not change anything in that regard on my Arch system.
Last edited by blackout23 (2013-01-16 21:10:45)
Maybe you have BUILDDIR set to /tmp in makepkg.conf?
Builddir is actually commented out with # in /etc/makepkg.conf and refers to /tmp/makepkg
Would changing it to my homedirectory solve the problem?
If it's commented out, building should be done in the directory PKGBUILD is in. You could run makepkg and see what's growing in /tmp with "du -hs /tmp*". If you can't move it out of /tmp, then you could (temporarily) make /tmp use the disk, not RAM - if you're not using systemd, comment out /tmp in fstab and reboot; if you're using systemd, you'd probably (additionally?) need to disable the unit mounting /tmp as tmpfs or somesuch.
By default, /tmp defaults to half your RAM if mounted in tmpfs. You can increase it to possibly 1.5Gb using the size=1536M mount option although you may still get OOM errors if your system uses more than the remaining if the compile fillls it up. You can also change the compile path to your ~
2 G might not be enough. As others have pointed out, tmp is 1/2 physical by default. Do you know how large the package you want to build is on disk with source and tmp files from make, etc? I'm guess >1 G. If you want to compile in RAM, consider adding more to the machine. If you cannot or will not, compile on disk.
Yes I'll just have to compile it on the disk. Obviously commenting something out in /etc/fstab out is not enought I'd also have to "sudo systemctl mask tmp.mount". Did not have time for this as of yet. Thanks for all your contribution!
2 GB is the RAM limit on my laptop motherboard. For 99,9% of my other tasks the laptop is more than adequat and fast enough.
Last edited by blackout23 (2013-01-17 20:58:05)