This article explores how threads enter a BLOCKED state in Kotlin due to lock contention. It includes a sample program demonstrating how ten threads can be blocked when accessing a synchronized method that forces them into prolonged sleep. Additionally, it discusses methods for diagnosing blocked threads, including both manual and automated approaches using tools like yCrash.
Data captured & analyzed by yCrash!
SRE engineers often restart applications without adequate data, complicating debugging efforts. The yCrash data script captures crucial 360-degree data, including garbage collection logs, thread dumps, and heap information. Additionally, tools like top, ps, netstat, and ping aid in monitoring and diagnosing system performance and network issues, facilitating better troubleshooting.
Simulating & troubleshooting CPU spike in Kotlin
This article describes how to simulate a CPU spike in Kotlin using an example program that launches six threads running infinite loops. It explains methods for troubleshooting high CPU consumption through both manual and automated approaches, highlighting the use of the yCrash tool to identify problematic threads and code lines causing the issue.
