Is it possible to profile the performance of coroutines using VisualVM? If it can be done how would the coroutines be profiled? I'm mainly interested in memory usage as I ended up with a bit of a scare the other day when the JVM crashed due to running out of memory. Noticed when running VisualVM that the profiled JVM program is using many threads which is concerning considering that the program only uses coroutines. Was expecting the thread count to average around 5 with the total CPU cores mainly affecting the thread count. Actual thread count is averaging around 29.
o
octylFractal
04/22/2020, 2:51 AM
somewhat, the coroutines will not have proper stacktraces due to how it's implemented, but all of the code will show up somewhere in the profiler, assuming you use profiling and not snapshots
n
napperley
04/22/2020, 2:55 AM
What are the differences between profiling, and snapshots? This is my first time profiling a JVM program.
Resource usage summary of the JVM program. Heap memory usage looks fine (max usage is around 65 MB), and is well under the max heap limit (nearly 1 GB).