-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
GC: enable logging to stderr when GC runs #43511
Conversation
and wasn't the most useful thing anyway
6 decimals for milliseconds is perhaps a bit excessive? |
Haha true. Truncated to 2 decimal points. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems reasonable
It appears that |
Should be to stderr? |
Ah, I think my docstring was wrong and it already does print to stderr, since it uses Line 624 in dc74954
Updated the docstring. |
Can you also edit the PR title to reflect whether this prints to stdout or stderr? |
Whoops, done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :)
Can you plz add a very simple test that just enables the printing and then triggers a GC and then disables the printing? Thanks!
🎄 Merry christmas! 🎄
Also we should add docs for this. |
@vchuravy Do you think docs and news? Or just docs? |
Instead (or in addition to) logging to STDERR, what about a way to register a callback that receives the same information? |
@sefffal that would be cool, but I'm a little unsure how to do it… Since no Julia code can run during a GC pause (where the println is now) I guess we'd have to somehow queue up the callback to run after GC unpauses? Not quite sure how to do that at the moment; my knowledge of this codebase is pretty limited… @NHDaly @vchuravy Julia contributor n00b question: where do I add docs and news? (besides the little docstring I put on the function?) |
I think just docs suffice, I tend to find a place in the manual that makes sense, maybe https://docs.julialang.org/en/v1/manual/profile/#Memory-allocation-analysis or in the devdocs, but we sadly don't have a devdocs section for the GC, and then find the right section in https://github.com/JuliaLang/julia/tree/master/doc/src News go here https://github.com/JuliaLang/julia/blob/master/NEWS.md |
Ok, added a bit of docs on this (and some headings) under the memory section of the profiling doc. (hopefully we'll be able to add another heading for #42768 soon…) |
For the News, i'd probably add it to one of these sections, at your discretion:
It can just be a one-line blurb that links to this PR, following the structure of the others. Thanks @vilterp! |
@vilterp This looks good to go, except for moving the function into the |
done, and added a test. |
Thanks Valentin! |
Co-authored-by: Nathan Daly <NHDaly@gmail.com>
Co-authored-by: Nathan Daly <NHDaly@gmail.com>
Useful to get a feel for how often GC is running and how much it's collecting.
was split off from #42768