Code Monkey home page Code Monkey logo

Comments (7)

Moelf avatar Moelf commented on June 12, 2024

Nice finding, I think basically the memorized function shouldn't take ROOTFile as input argument because that makes the key lingers in LRU cache.

But this shouldn't be a problem other than producing bigger mapping number right? Since we only MMap the file, it's technically not real memory used

from unroot.jl.

grasph avatar grasph commented on June 12, 2024

Moelf wrote: "But this shouldn't be a problem other than producing bigger mapping number right? Since we only MMap the file, it's technically not real memory used."

It uses virtual memory address space. This address space is quite large on 64-bit architecture and much more limited on 32-bit one. It's any case a good practice to release resource, when no more needed.

I've also observed that it increases the resident set size (RSS). I expect it's an artifact, because in my test it went well beyond the physical memory with no impact on performance. Nevertheless, it can be worrying for the user and can be a real problem if a limit is set on RSS usage (see ulimit). My linux kernel version is 5.10.0.

My guess is that file data loaded by the kernel in the memory buffer are counted, even they have been discarded and until the memory is unmapped.

Philippe.

from unroot.jl.

tamasgal avatar tamasgal commented on June 12, 2024

Thanks for the investigation and fix proposal Philippe!

I have not have time to reproduce the issue yet but was wondering if closing the file properly (which is also a good practice ;)) in your example would make any difference.

from unroot.jl.

grasph avatar grasph commented on June 12, 2024

It doesn't change. You need the ROOTFile instance and its fobj to be garbage collected, which was prevented by the reference in the LRU cache.

from unroot.jl.

tamasgal avatar tamasgal commented on June 12, 2024

Yes, you are right!

I think #261 should work, but have not verified yet.

from unroot.jl.

Moelf avatar Moelf commented on June 12, 2024

That PR also has tests

from unroot.jl.

tamasgal avatar tamasgal commented on June 12, 2024

Yep, saw them already. We can merge if you agree :)

from unroot.jl.

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.