Coder Social home page Coder Social logo

Comments (6)

Phantop avatar Phantop commented on May 13, 2024 1

@Phantop, just to make sure I understand this correctly: you're trying to build DwarFS image from a tree where single files have a size of 3.1GB; this single file by itself doesn't compress well, but it appears to be the root cause of mkdwarfs using an excessive amount of memory?

Yeah. The issue boils down to memory usage increasing to ludicrous levels with larger single file sizes, regardless of the size of the entire folder being compressed. I've had it happen in an 11GB folder with the largest file being ~650MB (which I managed to compress using lower memory and job options) and in a 7GB folder with a 1.1GB file (which required me to recompress). It's entirely due to single files.

This mostly makes sense. You can't change the block size (-S) during recompression, so that explains why it compresses much better with -S24. Nothing is stopping you from using -l0 -S24 initially if that helps. At -l0, the block size is 1MiB, just as with mksquashfs -b 1M, so again, no real surprise.

Yeah I'm aware of all this. just trying to make it clear that I have been able to compress images with these files, just after some workarounds. Really glad you're working on this!

from dwarfs.

mhx avatar mhx commented on May 13, 2024

@Phantop, just to make sure I understand this correctly: you're trying to build DwarFS image from a tree where single files have a size of 3.1GB; this single file by itself doesn't compress well, but it appears to be the root cause of mkdwarfs using an excessive amount of memory?

from dwarfs.

mhx avatar mhx commented on May 13, 2024

What I did find instead was that using the -l0 option and then recompressing the image works in these cases without issue. Creating the initial image with -S24 results in very well recompressed files in these instances, the 3.1 GB file compressing down to 2.3 GB whereas the default block size for -l0 resulted in a 2.6 GB file (which is approx what mksquashfs -comp zstd -b 1M -Xcompression-level 22 also gave me).

This mostly makes sense. You can't change the block size (-S) during recompression, so that explains why it compresses much better with -S24. Nothing is stopping you from using -l0 -S24 initially if that helps. At -l0, the block size is 1MiB, just as with mksquashfs -b 1M, so again, no real surprise.

from dwarfs.

mhx avatar mhx commented on May 13, 2024

@Phantop, I know exactly what the problem is. I just tried compressing my directory of virtualbox images and RSS memory consumption went through the roof (I stopped the process when RSS hit 50 GiB).

It's definitely fixable, but it's not a trivial fix, so it might take a bit of time. In the meantime, I've got a workaround: pass --blockhash-window-sizes=-. This may impact compression ratio a bit, but likely not as much as changing the block size. It should definitely fix your problem, though.

from dwarfs.

mhx avatar mhx commented on May 13, 2024

FYI, I've got a fix. (In fact, it's much more than a fix, it's a massive improvement that fixes this issue as a side-effect.)

from dwarfs.

mhx avatar mhx commented on May 13, 2024

Fixed in v0.4.0.

from dwarfs.

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.