Coder Social home page Coder Social logo

Comments (9)

wileyj avatar wileyj commented on June 3, 2024

do you have a partition for /tmp of a specific size?

from stacks-core.

jbencin avatar jbencin commented on June 3, 2024

My /tmp directory is a 16GB tmpfs filesystem, which lives in RAM/swap. That's the default setup for Arch Linux, and probably other distros as well

Even if it doesn't run out of space, it's still consuming a lot of RAM unnecessarily. I have 32GB here, and old files from cargo test can eat up half that

I know most of our devs use MacBooks, and I have no idea how OS X handles this and if it's a problem for them

from stacks-core.

jcnelson avatar jcnelson commented on June 3, 2024

FWIW, neither Debian nor Alpine use a RAM filesystem for /tmp. They use tmpfs, or nothing at all (it's just part of root).

from stacks-core.

jbencin avatar jbencin commented on June 3, 2024

tmpfs is not ramdisk but uses "virtual memory", which means data can be in either RAM or swap space. See tmpfs kernel docs here. So any distro that mounts tmpfs on /tmp is going to run into problems unless it is rebooted frequently

Am I the only one having an issue with this?

from stacks-core.

jcnelson avatar jcnelson commented on June 3, 2024

tmpfs is not ramdisk but uses "virtual memory", which means data can be in either RAM or swap space.

Right; you could conceivably deal with this problem by increasing your swap space. These distros' /tmp is backed not exclusively by RAM, but by a (user-chosen) amount of disk.

Am I the only one having an issue with this?

Maybe? My /tmp on my Linux boxen are all simply directories.

$ mount | grep 'on /tmp' | wc -l
0

The oldest file in this computer's /tmp is from August 19, 2021.

from stacks-core.

jbencin avatar jbencin commented on June 3, 2024

Maybe? My /tmp on my Linux boxen are all simply directories.

You're using Debian, right? Debian by default doesn't use tmpfs. Arch does. Not sure about other popular distros like Ubuntu, Fedora, etc.

Even if others aren't getting to the point where they are seeing actual test failures, I still think we should do something about it, because taking up extra RAM or disk space is never a good thing

Proposed Solutions

Used Fixed Names

Instead of using random file/directory names for each invocation of cargo test, use fixed names or psuedo-random names generated from a fixed seed. If data already exists from a previous test, remove it first

Implement Drop trait

Implement a simple wrapper around std::fs::File and implement Drop for it, so that the files are removed when the variable which owns them goes out of scope. Maybe not the right solution if we need to examine files after a failed test

from stacks-core.

jcnelson avatar jcnelson commented on June 3, 2024

Even if others aren't getting to the point where they are seeing actual test failures, I still think we should do something about it, because taking up extra RAM or disk space is never a good thing

We deliberately keep things on disk so we can inspect them on failed test runs, so that's probably not going to change. The value it provides for debugging is immense.

Why can't you just alter your /etc/fstab to not mount /tmp as tmpfs?

from stacks-core.

jbencin avatar jbencin commented on June 3, 2024

We deliberately keep things on disk so we can inspect them on failed test runs, so that's probably not going to change. The value it provides for debugging is immense.

I understand this. Is it useful to keep all of the data indefinitely, of can we only keep data from the most recent cargo test run?

from stacks-core.

wileyj avatar wileyj commented on June 3, 2024

from stacks-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.