/tmp counts towards memory usage? [no, it was just me being stupid]

I tried putting extremely bulky wav files into /tmp but now my project is now out of disk space. I did not use __dirname btw, I used the root /tmp directory, which seems to be what was intended by the statement from here.

  • Projects have a limit of 200MB of disk space in the container. The contents of your project’s ‘/tmp’ directory don’t count towards that total, but those files are removed when the project restarts. By default your Node.js modules don’t count towards that total - there’s a separate 1GB limit for node modules. Plus, there’s an additional 512MB of assets storage space.

Is this false advertising, to good to be true, or am I missing something? (My plan was to have mp3s stored in /app and then convert them once the project started and store them in /tmp.)

Hey @Frank-9976 the contents of the tmp directory shouldn’t be counted in your project’s disk space, but I haven’t done a ton of testing around that. Can you share your project name so we can take a look?

1 Like

May I make a dummy project to avoid risking damaging my own project?

If you’d prefer, sure. If you share your existing project name we won’t make any changes to it without Remixing it or telling you what we plan to do, and we’ll respect any private data it contains. But if you’d prefer to share a Remix that’s perfectly fine.

1 Like

Actually, the reason why I wanted to make a dummy project was so I could do some testing to make sure this wasn’t me using up my working memory. And it was. https://glitch.com/edit/#!/tmp-dummy works fine. On the other hand, for all future visitors and me specifically to this page, what can cause buffers to be written to disk non-explicitly?
EDIT: never mind, I just had a bug in there

New question; I’ve got my preloader working now, but now some of the files, but not all, are disappearing before reload. Is there some sort of system by which old files in tmp get silently discarded? Am I allowed to cheese disk limits like this?
There should be 0 - 40.wav [file folders 13 - 16 are expected]
[EDIT: it works now, but still want to know]

$ dir /tmp
10.wav 11.wav 12.wav 13 14 15 16 19.wav 39.wav 4.wav 5.wav 9.wav tmp.F8rCzQVIA1

If I understand your question correctly, /tmp should only be cleared when the project restarts, so if you’re seeing different behavior I’d have to investigate.

Also keep in mind that if your project’s /tmp usage gets out of hand we may suspend the project, and we may change how /tmp is considered in the future.

1 Like

So far I think everything I’ve found has been a problem between the keyboard and the chair, but I’m worried now that /tmp works TOO well and might be a security hole. I’d compare this to Olive Garden’s breadsticks, in that theoretically you could gain infinite resources, but in practice that isn’t how it works. Of course, my project is handling huge buffers and the working memory can easily get overloaded. But someone could easily start shoveling data into /tmp using small bits and pieces if they wanted to overload glitch’s memory reserves. Should I test this using https://glitch.com/edit/#!/tmp-dummy to see what happens when you take shoveling to the max?

I don’t think there’s any need to test that - we already see projects abusing /tmp and suspend them when they come up.

1 Like

olive garden… nice joke there XD, definitely eat way to many breadsticks myself