Replies: 2 comments 1 reply
-
Is this a console app? If you have a sync context, await should restore you back to the original thread. GC.GetAllocatedBytesForCurrentThread for threadpool'ed thread probably doesn't make much sense |
Beta Was this translation helpful? Give feedback.
1 reply
-
to clarify: I need any way to track allocations. if it feasible without GetAllocatedBytesForCurrentThread, I'm fine! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to collect allocations for a method (or for hierarchy of methods) with
await
s. Something like the following:I can't use global allocation counters, due to a lot of threads runs in the same time, and I need to know allocation for all of them individually.
I tried custom
AsyncTaskMethodBuilder
: 1) aggregate allocations between thread switching into some kind ofAsyncLocal
container 2) and restart to collect after thread switching, but looks like that's infeasible, at least with my way.Any ideas? Approaches?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions