Skip to content

What's the best way to stop /tmp from filling up?

This has happened to me several times: my /tmp directory becomes full, and then programs start crashing and failing to start. What do I do to prevent this?

8 points12 comments
Open on Reddit
About this post
Posted
Archived
Score
8 · 100% up
Kind
Text
ID
d5ppgi

Author

41
posts
110
comments
29
media
View profile

12 comments

Find out and fix whatever is dumping shit in /tmp and not cleaning it up. It's not "normal" behavior for /tmp to fill up.

16 points

Not a bad idea, lol. Thanks. Didn't realize it was that abnormal, but I probably should have.

3 points

Okay well it just happened again, and lsof told me that the Battle.net client had a bunch of "anonmap" file descriptors open, that were originally created in /tmp. I exited that, then also killed wineserver (as Battle.net is a Windows app) and that instantly brought me all the way from 0 bytes free (out of 7.8G) up to 6.2G free. So thanks again. :)

Now I'm curious, is it a resource leak of some kind in Battle.net that translates over to /tmp wastage, or is there a bug in Wine that's doing it?

1 points

What do you mean it becomes full? It's directory for temporary files. Programs store there, nomen omen, temporary files which are deleted after reboot.

11 points

It starts giving errors saying there's no more space on the "device", then when I do df -h, it says it's full.

1 points

And what is the content of the /tmp when you encounter this problem?

EDIT: "encourage"...

6 points

/tmp is a ramdisk typically set to half of your system RAM. It's pretty abnormal for it to fill unless you've got a rogue app or very little total memory. Find out what app is dumping large files to it and change that app to use a different temporary storage location (that's not in-memory).

5 points

dont forget. wipe the /porn directory once a week too...

5 points

Clearly you need to reduce boot time so you can reboot more often /s

What I'd probably do if I was in your shoes was to narrow down what is filling tmp up, by either checking it when it becomes full or trying to trackback what I used in the session.

If I can narrow it down to a single program, either add a hook script to clean tmp after it closes or fix the program somehow.

If all else fails, probably making a somewhat decent disk partition (yay lvms) and syslink it as a workaround with what I assume powered by the raging anger of the community because of how bad of a plan that is

3 points

Did you explcitely set its size in fstab? If so, increase it or remove the cap. Other alternatives are rebooting more often or delete it periodically, though this could possibly cause instability for open applications.

No matter which option you choose, it is probably good idea to find out what is filling it up, as typical system usage does not fill it up very quickly.

2 points

Obtain more RAM, try using zram, or find the problem cause. You practically have an application leaking "memory" (/tmp disk space). Solve that, obtain more RAM, or set it to be a freshly formatted partition every boot.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.