-
-
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
Allocations of Julia Tasks' stacks are missed by @time
and Allocation Profiler, and at least 9 other allocations missed by Allocation Profiler
#48216
Comments
I'm not sure what the other 8 missing allocations are yet. EDIT: Oh wait, duh, nvm, the existing allocations already sum to |
CC: @gbaraldi, @IanButterworth |
EDIT: Oh wait, duh, nvm, the existing allocations already sum to |
@time
and Allocation Profiler, and at least 9 other allocations missed by Allocation Profiler
K, i updated the description per my new understanding. |
We might not want to report the stack allocation anyway, it's kind of a deep internals thing that might make a user go crazy. I do wonder where the other allocations are coming from. I guess an rr trace to see when the allocation counter goes up but we don't record the allocation. |
Yeah, i'm not sure either.. I think that it might be useful though, since it is ultimately part of the user's program, and it's something that they have control over. E.g. if you find you're unexpectedly spawning like 10,000,000 tasks or something, and it's your main contributor to allocations? But i can see the argument not to report them as well...
Great idea, yeah! :) I don't think we have the cycles to push on this now, but i'll leave this idea here for the future, or for if you or anyone there has the cycles+interest to hunt these down. Thanks! 😊 |
If it was solely up to me, i think i'd lean towards reporting the allocations of the Task stacks as well. I'd also be interested to check to see what Golang's allocations profiler does, and whether or not they report them. |
CC: @vilterp as well |
The task stack is anonymous memory, we ask the OS for 4MiB but the actually allocation does not happen. So this is potential memory use not actual memory use. The cost of memory will be incurred when the stack actually grows to that size. So I don't think we should report it as part of |
💡 oh cool, thanks! I didn't know that. That's nifty. Okay yeah i think that sounds reasonable then. 👍 thanks! Should I repurpose this issue for the remaining 9 other missing allocs, or close it and open a new one? |
I'm curious if this is related to #50187 |
🤔 it doesn't look like it's exactly the same, since no tasks involved, but agreed that it's the same symptom... Yeah, maybe they're related! 💡 Thanks @charleskawczynski. I commented on the other thread too 👍 |
There are 9 objects being allocated when allocating a Julia Task that are missed by the Allocation Profiler (#42768).
Additionally, both the Allocation Profiler and
@time
are missing the allocation of the stack for a Julia Task.You can see in the following example, that we are actually missing around 9 allocations,
including the allocation of the Task stack,but they are tracked by@time
:I think the stack allocation happens here, but i'm not 100% sure:
julia/src/gc-stacks.c
Lines 150 to 182 in b7201d6
or maybe this is a better place to instrument - this is the actual site of the
mmap
:julia/src/gc-stacks.c
Lines 53 to 67 in b7201d6
Where does this get tracked and added to the allocs reported in@time
?EDIT: I believe that the stack allocation is also not being captured by
@time
, since I think they're more like 4MiB, and I don't see any accounting for the allocation in the above code.The text was updated successfully, but these errors were encountered: