Skip to content
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

Distinction between total allocated memory and memory allocated at the end of run #143

Open
lukas-lansky opened this issue Nov 11, 2016 · 0 comments

Comments

@lukas-lansky
Copy link

I was trying to find a little bit more about how TotalBytesAllocated works as it wasn't clear to me at the beginning whether it tries to compute sum of allocations program makes during its run, or whether it measures size of the heap at the end of run.

I think both variants have reasonable use cases: the first one is concerned with memory and GC pressure, the second one is good when looking for memory leaks.

Finally I found GcTotalMemoryCollector class from which it seems to me that the current implementation is kind of hybrid between the two variants: it's not the sum of allocations as it asks for GC.GetTotalMemory only once; it also not the total heap size as it refuses to call GetTotalMemory(true). It's totally possible I read the code in a wrong way and this reasoning doesn't apply.

I would suggest to

  • update documentation that would clarify the meaning of the option;
  • think about creating two distinct options with clear use cases.

I'm willing to help if someone more knowledgeable validates my suspicions.

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

No branches or pull requests

1 participant