Skip to content

Memory consumption during uproot.iterate #1041

Answered by agoose77
tomeichlersmith asked this question in Q&A
Discussion options

You must be logged in to vote

The default uproot source for reading files from disk uses memory mapping (mmap). Memory mapping is useful to avoid an extra copy of the data when reading, to share (re-use) memory between processes, and to improve performance of random access (c.f. https://stackoverflow.com/a/6383253). However, it has some drawbacks; namely that the OS is responsible for managing the memory (and also, the cache is populated via page faulting). In this case, I think the behaviour that you're seeing is a direct consequence of the kernel caching memory pages, and choosing not to free them (c.f. https://stackoverflow.com/a/1972889).

If you want to avoid this caching, you can open the file yourself and pass t…

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@tomeichlersmith
Comment options

Answer selected by tomeichlersmith
Comment options

You must be logged in to vote
3 replies
@tomeichlersmith
Comment options

@lobis
Comment options

@martindurant
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants