@ExperimentalCoroutinesApi object DebugProbes
Debug probes support.
Debug probes is a dynamic attach mechanism which installs multiple hooks into coroutines machinery.
It slows down all coroutine-related code, but in return provides a lot of diagnostic information, including
asynchronous stack-traces and coroutine dumps (similar to ThreadMXBean.dumpAllThreads and
jstack via DebugProbes.dumpCoroutines.
probeCoroutineResumedis invoked on every Continuation.resume.
probeCoroutineSuspendedis invoked on every continuation suspension.
probeCoroutineCreatedis invoked on every coroutine creation using stdlib intrinsics.
- Every created coroutine is stored in a weak hash map, thus adding additional GC pressure.
- On every created coroutine, stacktrace of the current thread is dumped.
- On every
suspend, WeakHashMap is updated under a global lock.
Whether coroutine creation stacktraces should be sanitized.
Sanitization removes all frames from
Dumps all active coroutines into the given output stream, providing a consistent snapshot of all existing coroutines at the moment of invocation.
The output of this method is similar to
Returns all existing coroutines info. The resulting collection represents a consistent snapshot of all existing coroutines at the moment of invocation.
Uninstall debug probes.
Invokes given block of code with installed debug probes and uninstall probes in the end.