Coder Social home page Coder Social logo

Comments (9)

j4yk avatar j4yk commented on May 28, 2024 1

FileSystem-Git is the likely culprit, yes. Currently, each time an object is looked up, a new file stream is opened. There is some caching in place already, but it could be better or is not very helpful yet. The Squit browser could also do less when a reference has not changed, for example. Or generating the object list should not involve extracting the artifacts from the files, etc. There is a lot of work to do (or to save...), when there is time.

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

I don't even get to see any instances, because of #33.
So currently, both statements return an empty collection in my image.

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

Okay, so I can confirm that this is also the case on macOS. It is actually the root cause for #33, because on macOS Sierra the default limit for the number of open files per process appears to be 256. Raising the limit temporarily "fixes" #33 until the new limit is hit. After a few seconds, unfortunately, the number of open pack files already is larger than 10,000.
It'd be great if you could fix this next, as it makes Squot and even the entire image unusable...

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

I can only guess at this point, but is it possible that the unpacker ends up in an endless recursion for some reason? unpackWithoutIndexFile also looks a little weird. Why decrement count when using timesRepeat:?
StandardFileStream has a finalize method, maybe FSFileHandle also needs one? (Tried this already, but nothing really changed).
It's very weird that this only happens with pack files...

from squot.

j4yk avatar j4yk commented on May 28, 2024

The image does not hanging there is no forking going on in FileSystem-Git so there should not be an endless recursion. The count temporary is doubly used as a "remaining" counter. Do not remember from the top of my head what it is used for (sitting in a car atm).

A missing close on garbage collection would explain why the OS handles remain open, but no open FSHandles exist. Don't know if I'll be able to find and fix the problem before my departure to Finland, though.

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

Okay, so finalize seems reasonable, but does not solve the problem. It seems that each pack file is opened multiple times without closing it. This is what it looks like in macOS' Activity Monitor:

9
/Users/fniephaus/code/Squot/.git/objects/pack/pack-880f8345f2b0117652489bd69ec4d3f5cc28b533.pack
10
/Users/fniephaus/code/Squot/.git/objects/pack/pack-9e1de978700c6d1a7f468a1c95c0b952f44db11b.pack
11
/Users/fniephaus/code/Squot/.git/objects/pack/pack-880f8345f2b0117652489bd69ec4d3f5cc28b533.pack
12
/Users/fniephaus/code/Squot/.git/objects/pack/pack-880f8345f2b0117652489bd69ec4d3f5cc28b533.pack
13
/Users/fniephaus/code/Squot/.git/objects/pack/pack-9e1de978700c6d1a7f468a1c95c0b952f44db11b.pack
14
/Users/fniephaus/code/Squot/.git/objects/pack/pack-880f8345f2b0117652489bd69ec4d3f5cc28b533.pack
15
/Users/fniephaus/code/Squot/.git/objects/pack/pack-880f8345f2b0117652489bd69ec4d3f5cc28b533.pack
...

from squot.

j4yk avatar j4yk commented on May 28, 2024

I think I solved it in 721bc9d. Implementing finalize does not suffice, you have to add the object to a WeakRegistry to have it finalized. During my tests, all handles are properly closed now, please check.

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

Thanks, I realized that I need a WeakRegistry, but added it to FSHandle, so that FSMemoryHandles are also closed when GCed. However, my version is still not working, but checking again with yours. Nonetheless, it looks like Squot/Squit does lots of (sometimes redundant) I/O operations. Not sure where caching would be useful...

from squot.

fniephaus avatar fniephaus commented on May 28, 2024

Sounds good! 😃 And even better: your version seems to be working just fine. Thanks!

from squot.

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.