-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Docs: add GC user docs #58733
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
base: master
Are you sure you want to change the base?
Docs: add GC user docs #58733
Conversation
b89ff2d
to
e875ca7
Compare
doc/src/manual/memory-management.md
Outdated
|
||
By default, Julia uses multiple threads for garbage collection: | ||
|
||
* **Mark threads**: Used during the mark phase to trace object references (default: same as compute threads (thread 1 is shared)) |
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.
* **Mark threads**: Used during the mark phase to trace object references (default: same as compute threads (thread 1 is shared)) | |
* **Mark threads**: Used during the mark phase to trace object references (default: 1, which is shared with the compute thread if there is only one, otherwise half the number of compute threads) |
the nested parenthetical here reads a bit odd, and I'm not sure how to square the information with https://docs.julialang.org/en/v1/manual/multi-threading/#Multiple-GC-Threads stating that #mark threads = 1/2 #compute threads
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.
Maybe the point I was trying to highlight isn't important, but the first gc mark thread is the same thread as thread 1.
% ./julia -t6 -q
julia> versioninfo()
...
Threads: 6 default, 1 interactive, 6 GC (on 6 virtual cores)
julia> Threads.maxthreadid()
12
(not 13)
I've been confused by that before. But maybe that's too niche.
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.
now I'm confused even more 😁, if there are 6 worker threads and 6 GC threads, how is that "half the number of compute threads" ? are the original docs wrong?
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.
Oh right.. good point
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.
Yes, the default number of GC threads is now --threads.
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.
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.
Ok. I added a docs fix, not not sure if I found every instance. It's a hard thing to search for.
Co-authored-by: Andy Dienes <51664769+adienes@users.noreply.github.com>
Closes #54565
Initially generated using Claude 4, with review and tidyup.
@d-netto or others on the GC team, please feel free to push to this directly.