inspectit-ocelot
inspectit-ocelot copied to clipboard
Use Thread.dump for collecting stack traces
Currently we use Thread.getAllStackTraces for stack trace collection. This is done over Thread.getStackTrace because Thread.getStackTrace wopuld stop ALL threads anyway (safepoint).
However, at least on OpenJDK and OracleJDK there is private static native Thread.dump(Thread[] thread). This still stops all Threads, but only collects the stack traces for the given Threads. We should use this method whenever possible.