Skip to content

Fix #81585: Reused cached_chunks are not counted to heap size #7732

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Dec 7, 2021

Whenever we reuse or delete a cached_chunk, we need to adjust the
memory stats like we do when allocating or deleting a non cached chunk.

Whenever we reuse or delete a `cached_chunk`, we need to adjust the
memory stats like we do when allocating or deleting a non cached chunk.
@cmb69
Copy link
Member Author

cmb69 commented Dec 7, 2021

@dstogov, do you see any issues with this fix?

@dstogov
Copy link
Member

dstogov commented Dec 8, 2021

Zend MM keeps in real_size the amount of allocated system memory. This includes the allocated cached pages, as we don't return them to system. This counting was done on purpose. Accurate information about memory used by PHP application is available in size.

I don't see a big reason to change this.

@cmb69
Copy link
Member Author

cmb69 commented Dec 8, 2021

Thanks for the explanation, @dstogov. And of course, you're right! I'll come up with another PR which does not change real_size.

@cmb69 cmb69 closed this Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants