-
Notifications
You must be signed in to change notification settings - Fork 67
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
More types of memory measurement (process heap size, retained memory) #262
Comments
Hi Tobias! |
#262 reminded me of just how strange this code might be to people new to the code base and also to myself after a couple of months. This general information should help :)
@alvises 👋 So I just opened #263 to make this maybe a bit more discoverable. What you're looking for (and what too me more googling than it should have) is http://erlang.org/doc/man/erlang.html#gc_minor_start
Total memory used to the best of my understanding is So that size after running the function and triggering GC should be the retained memory. As for what is the total process size I'd have to half guess/dig deeper - heap_block_size + old_heap_block_size + stack_size? I'm unsure but sadly don't have the time to read up on it. @devonestes @michalmuskala do you have any further insight? Also @alvises great that you look at it, not to deter you but just wanna mention again that I think we'd most likely get this in for realz after 1.0 (gathering the values should be okay but displaying it in all the formatters would take quite some time so I see it more as a 1.1 right now but yes that means I should take the time to do 1.0 😁 ) |
In a recent blog post using benchee by @alvises I wondered why the author didn't use benchee for memory measurements so I reached out and it happens that what we measure doesn't seem to be what was important here:
The thing is that we measure the total memory allocated - even the memory that was garbage collected which is what we want :) However, it'd be interesting to see a couple of others:
The question is of course how to implement this - as our memory measurer already has all the data the simplest solution might be to just let it return the 3 values in a tuple or so.
Another interesting thing is the output - for a lot of use cases (pure functions) I expect all of these values to not change so instead of printing 3 different sections we could just output "this value this, that value that and the other value that"
This is a post 1.0 thing, it's very nice but we should really get 1.0 out and it shouldn't be breaking to the outside as we'd just add fields/data not remove or rename.
The text was updated successfully, but these errors were encountered: