GithubHelp home page GithubHelp logo

Comments (10)

d4rky-pl avatar d4rky-pl commented on May 23, 2024 1

Before yarn cache clean:

 releasable space: 377791.00 mb

After yarn cache clean:

releasable space: 4207.00 mb

The size of yarn cache:

5.6G	Yarn

@zaldih I believe this is indeed because of the rounding issue. Almost all of the folders were reported as having 1 mb. An excerpt:

  /Users/matyas/Library/Caches/Yarn/v4/npm-array-find-index-1.0.2-df010aa1287e164bbda6f9723b0a96a1ec4187a1/node_modules      1 mb
  /Users/matyas/Library/Caches/Yarn/v4/npm-pretty-error-2.1.1-5f4f87c8f91e5ae3f3ba87ab4cf5e03b1a17f1a3/node_modules          1 mb
  /Users/matyas/Library/Caches/Yarn/v4/npm-query-string-6.8.1-62c54a7ef37d01b538c8fd56f95740c81d438a26/node_modules          1 mb
  /Users/matyas/Library/Caches/Yarn/v4/npm-filesize-3.6.1-090bb3ee01b6f801a8a8be99d31710b3422bb317/node_modules              1 mb
  /Users/m...ary/Caches/Yarn/v4/npm-character-entities-legacy-1.1.3-3c729991d9293da0ede6dddcaf1f2ce1009ee8b4/node_modules    1 mb
  /Users/m...brary/Caches/Yarn/v4/npm-eslint-plugin-flowtype-2.50.3-61379d6dce1d010370acd6681740fd913d68175f/node_modules    1 mb
  /Users/matyas/Library/Caches/Yarn/v4/npm-diff-sequences-24.3.0-0f20e8a1df1abddaf4d9c226680952e64118b975/node_modules       1 mb

from npkill.

zaldih avatar zaldih commented on May 23, 2024

omg it seems that npkill found a quantum link!

Thank you for opening this issue. We will investigate the origin of this calculation failure (I suspect that it may be a problem of rounding figures as there are so many directories).

  • Do you know how much space the cache really occupied?
  • Those ~ 2GB that shows npkill correspond to the actual size or is it also wrong?

from npkill.

phoenecke avatar phoenecke commented on May 23, 2024

The 2 GB seems correct and it finds the same amount each time I run it.

Another thing I forgot to mention is that I ran it twice before doing yarn cache clean and it gave different results. The first time, it was about 570 gb and the second time it was over 600.

Unfortunately I did not check the real size of the Yarn cache before cleaning it.

from npkill.

zaldih avatar zaldih commented on May 23, 2024

Yess! Is a problem fo rounding.
I have been able to verify that in windows this does not happen because its service has more precision.

Captura

However, linux service uses the du command with some parameter that rounds at least 1mb, although a directory only occupies 0.01mb

const du = spawn('du', ['-sm', path, '--max-depth', '0']);

A possible solution would be to investigate how to get the size in bytes with that command, and convert them to mb in the same way as windows service does.

This seems like a simple bug for anyone who would like to contribute to the repo for the first time. πŸ˜ƒ

Does anyone take it?

from npkill.

NyaGarcia avatar NyaGarcia commented on May 23, 2024

I'll fix it :D

from npkill.

zaldih avatar zaldih commented on May 23, 2024

The problem should now be fixed in #18 πŸŽ‰
In the next update this fix will be included

from npkill.

NyaGarcia avatar NyaGarcia commented on May 23, 2024

Issue should be fixed from version 4.0.0 onwards

from npkill.

maxdevjs avatar maxdevjs commented on May 23, 2024

Got this today :)

Yarn cache was around 300MB, npkill returned around 260GB πŸ€”

from npkill.

NyaGarcia avatar NyaGarcia commented on May 23, 2024

@maxdevjs We realized that by merging #74, the bug reappeared. I'm working on a solution on this branch. However, my solution would only fix the bug on Linux, not MacOS.

This is because the du parameter that fixes the bug (--apparent-size) has no equivalent in MacOS (as far as I know). I'm researching for a way to fix it in MacOS, but so far I haven't found anything. If anyone has any ideas, I'd love to try them out :)

from npkill.

maxdevjs avatar maxdevjs commented on May 23, 2024

@NyaGarcia thank you for the reply.

I quickly checked #74 and the suggested branch, I guess the solution you are working on is

const du = spawn('du', ['-s', '--apparent-size', '-k', path]);

right?

That said, my bad! Just to be clear, I tried it on Linux.

This changes the focus of my question: currently happens on both Linux and MacOS?

from npkill.

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.