Virtual Thread Support
Describe the feature
I saw in https://github.com/async-profiler/async-profiler/issues/1275 a suggestion to file a ticket for tracking Virtual Thread support, but it doesn't look like anybody did that yet, so here goes.
My request for Virtual Thread support would be an option to get the full virtual stack for vthreads when they are mounted to a carrier thread.
Use Case
Today when profiling an application with virtual threads, most of the stacks will be truncated at arbitrary locations depending on which frames the Continuation happens to have loaded into the real stack. As an example, in the screenshot below, the methods called by Continuation.enterSpecial aren't stack roots or IO points or anything else.
One of the promises of the Loom project was better, more coherent stack traces than for reactive/async/coroutine frameworks, but until we have better integration with tools like this, the stacks are just as disrupted and it's hard to get the full picture of where an application is spending time/allocating memory.
Ideally we could collect both native and virtual stack traces at the same time. This would allow for continuous profiling with both enabled, providing the ability to analyze both perspectives.
Proposed Solution
No response
Acknowledgements
- I may be able to implement this feature request
- This feature might incur a breaking change
Source: async-profiler/async-profiler