Skip to content

misleading claim "the FUSE process uses 12-40x the RAM" for DwarFS #2

Open

Description

@Samueru-sama

@probonopd

That is doing what it is supposed to do!

The uruntime sizes that cache from the host's free memory at launch, and limits it hard when memory is tight:


https://github.com/VHSgunzo/uruntime/blob/v0.8.1/src/main.rs#L3849-L3866:

fn get_dwfs_cachesize() -> String {
    get_dwfs_option("DWARFS_CACHESIZE",
        &if let Ok(meminfo) = <procfs::Meminfo as procfs::Current>::current() {
            let available_memory = meminfo.mem_available.unwrap_or(meminfo.mem_free) as f64;
            let available_memory_mb = available_memory / 1024.0 / 1024.0 / 1.3;
            let cache_sizes_mb: [u32; 10] = [1536, 1024, 896, 768, 640, 512, 384, 256, 128, 64];
            let cache_size_mb = cache_sizes_mb.iter()
                .find(|threshold| available_memory_mb > (**threshold as f64))
                .copied().unwrap_or(32);
            format!("{}M", cache_size_mb)
        } else { DWARFS_CACHESIZE.into() })
}

It reads /proc/meminfo and takes the largest value strictly below MemAvailable / 1.3. A GitHub runner reports ~16 GiB, so it gets the max, 1536 MiB. A 1 GiB machine gets 512 MiB, and under ~83 MiB free it drops to 32 MiB.

That choice drives the rest too (main.rs:3869-3937): workers is all CPUs at 1536M/1024M, 2 at 896M, 1 below, and the small tiers get tidy_interval=500ms,tidy_max_age=1s instead of 2s/10s, so blocks are freed far more eagerly. And it is overridable via DWARFS_CACHESIZE en variable.

Unused ram is wasted ram!

Activity

  1. added a commit that references this issue on Oct 9, 2026
  2. probonopd commented on Oct 9, 2026

    @probonopd
    Owner

    Here we are getting into the territory of the objectives of a compression scheme. You can see the criteria and weights I have applied. These are key aspects I care about in an AppImage compression scheme, and I would assume many users will.

    With current RAM prices and people being forced to squeeze as much as possible into as little RAM as possible, this is wasteful and should imho be changed to use the minimal amount of RAM one can get away with, to leave as much as free RAM as possible to the applications.

  3. Samueru-sama commented on Oct 9, 2026

    @Samueru-sama
    Author

    That's not wasteful, it is making correct use of resources to improve the user experience. These stuff have alraedy been tested on ancient systems and they perform better than squashfs.

    AppImage has been commonly criticized for its slow launch times, dwarfs fixes this problem while keeping it small. I mean without even talking about dwarfs, the recommendation here is squashfs zstd7 and 128K blocks??? That's going to produce fatter appimages than the default settings your appimagetool lol

    If anything people run into disk space issues, I actually have this problem right now on my system, and there are systems out there like the 64GiB version of the steamdeck that people use.

    Image

    Modern linux already pulls miracles with ram management without any sort of disk swap, just watch this video: https://www.youtube.com/watch?v=nMYTBsjeoTc

  4. Samueru-sama commented on Oct 9, 2026

    @Samueru-sama
    Author
  5. Samueru-sama commented on Oct 10, 2026

    @Samueru-sama
    Author

    @probonopd

    The readme now states this:

    Making the cache small does not remove the gap: even with a 64M cache the DwarFS process uses 150-300 MB (6x squashfs here), because it also holds metadata and decompression buffers

    The rationale is wrong, the reason RSS is higher still is due to DWARFS_READAHEAD. testing locally:

    configuration blocks peak RSS peak RSS wtih DWARFS_READAHEAD=0
    SquashFS: 128K, zstd7 128K 30.8 MB -
    SquashFS: 1M, zstd22 1M 120.4 MB -
    DwarFS: 1M blocks, zstd22 32M cache 1M 231.5 MB 145.5 MB (close to squashfs for the same block size)
    DwarFS: 1M blocks, zstd22 64M cache 1M 270.3 MB 192.6 MB
    DwarFS: 64M blocks, zstd22 64M cache 64M 330.1 MB 330.1 MB

    I need to test launch time with and without readahead, but right now it seems readahead actually hurts than help, before it used to help but dwarfs and the uruntime have changed a lot since then (like the case hotness list no longer having a measurable impact for example).

  6. probonopd commented on Oct 10, 2026

    @probonopd
    Owner

    @Samueru-sama thanks for looking into this. I am happy to re-run the tests if you can tell me how exactly to run/configure uruntime and/or DwarFS. Thanks!

  7. Samueru-sama commented on Oct 10, 2026

    @Samueru-sama
    Author

    6. @Samueru-sama thanks for looking into this. I am happy to re-run the tests if you can tell me how exactly to run/configure uruntime and/or DwarFS. Thanks!

    Two things:

    • -S26 -B6 is no longer used, instead -S26 -B2 is prefered instead, why? Because when the DWARFS_CACHESIZE gets down to 128M throughput drops to 60 MB/s with -B6 which is bad, however with -B2 it just drops to 158MB/s which is still a significant impact on performance but not that terrible.

    • Dwarfs RSS is not higher because "it also holds metadata and decompression buffers", if you compare dwarfs vs squashfs both using 1MB blocks, RSS will be similar as long as DWARFS_READAHEAD is set to 0.

    Caveat, both of these things were done with local tests, it is not guranteed this will translate to the CI tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions