You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Issue with large memory usage when creating a memory mapped array #7732
Yeah, I think that's all working correctly and doing what you want, and your tool is just counting "in memory cache of the mmap'ed file" memory into the same accounting bucket that it uses for regular allocations of non-file-backed memory. Which is actually fairly reasonable; the fundamental problem is that in a virtual memory world there isn't really any meaningful single number answer to "how much memory does this process use". People feel like there should be, so lots of tools will obligingly make something up, but it's very misleading in lots of situations, including this one.
I've been trying to think how to answer more helpfully, but I think really the only solution if you care about these things is to do some study on how virtual memory works, because the conceptual framework is fundamentally different from the simple model we teach beginners.
Activity
seberg commentedon Jun 12, 2016
Not sure how it works, but might it not be your OS grabbing the memory because it is available, and it would not do it if it was not free?
njsmith commentedon Jun 12, 2016
Yeah, I think that's all working correctly and doing what you want, and your tool is just counting "in memory cache of the mmap'ed file" memory into the same accounting bucket that it uses for regular allocations of non-file-backed memory. Which is actually fairly reasonable; the fundamental problem is that in a virtual memory world there isn't really any meaningful single number answer to "how much memory does this process use". People feel like there should be, so lots of tools will obligingly make something up, but it's very misleading in lots of situations, including this one.
I've been trying to think how to answer more helpfully, but I think really the only solution if you care about these things is to do some study on how virtual memory works, because the conceptual framework is fundamentally different from the simple model we teach beginners.