Skip to content

Heap size larger than resident size? #246

Answered by pablogsal
andronat asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks for opening this discussion!

Without looking at the code is difficult to tell for sure but this is kind of behaviour normally indicates that your application is requesting a lot of memory that’s not using. When you call malloc() you increase your heap size because you retested the memory but until you actually touch touch that memory by writing something to it, the OS won’t actually give do anything important so your resident size won’t increase.

You can do an easy experiment to see this: with numpy, allocate a big array with numpy.empty() and another one with numpy.zeros(). In the first case your resident size won’t increase but in the second it will (because writing zeros to the …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by pablogsal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants