2

I have a virtual server (Debian 8.5, OpenVZ) that seems to run out of memory* when tmpfs-based /tmp is about 60% full.

(* while the system reports 2GB of memory still free, processes start to behave erratically, /tmp writes fail with ENOSPC, forking fails with ENOMEM, some connections drop with ENOBUFS, and eventually sshd starts closing connections during handshake).

Is this normal for tmpfs, or is my system somehow horribly misconfigured?

Can it be fixed by shrinking size of /tmp?

How can I resize /tmp if it's not in /etc/fstab?


 Filesystem Size Used Avail Use% Mounted on /dev/ploop25777p1 150G 19G 126G 13% / devtmpfs 2.0G 0 2.0G 0% /dev tmpfs 2.0G 0 2.0G 0% /dev/shm tmpfs 2.0G 17M 2.0G 1% /run tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup tmpfs 2.0G 68K 2.0G 1% /tmp none 2.0G 0 2.0G 0% /run/shm 
 proc /proc proc defaults 0 0 none /dev/pts devpts rw,gid=5,mode=620 0 0 none /run/shm tmpfs defaults 0 0 
1
  • This looks like your VPS provider has oversubscribed the node. Go somewhere else, and avoid OpenVZ. Commented Jul 26, 2016 at 17:31

1 Answer 1

2

tmpfs is a filesystem in memory, that can hog your memory if you have a lot of tmp files that do not get cleaned up.

You can use the filesystem for /tmp by editing /etc/default/tmpfs and reboot.

But you should really find out why /tmp is filling up.

Edit: You can also limit the size in the file...

2
  • My program is deliberately filling up tmp as long as there's more than 10% free space on /tmp. The problem is that machine dies long before tmp is full. Commented Jul 28, 2016 at 17:14
  • Then you should either limit the size, or move to disk. Commented Jul 29, 2016 at 7:01

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.