Simulating & troubleshooting Thread leak in Kotlin

Опубликовано: 08 Май 2026
на канале: yCrash
87
3

In this series of simulating and troubleshooting performance problems in Kotlin, let’s discuss how to simulate thread leaks. ‘java.lang.OutOfMemoryError: unable to create new native thread’ will be thrown, when more threads are created than the memory capacity of the device. This error will disrupt the application’s availability.

If you liked this video, you'll love our Java Performance Masterclass. Learn more:
https://ycrash.io/java-performance-tr...

- - - - - - - - - - - - - -

Topics covered:

00:25 - Kotlin Sample Thread leak Program
03:15 - How to diagnose ‘java.lang.OutOfMemoryError: unable to create new native thread’?
04:03 - yCrash root cause analysis report

- - - - - - - - - - - - - -

Links shared in the video:

Capture thread dump using one of the 8 options mentioned here:
https://blog.fastthread.io/2016/06/06...

Samurai:
https://github.com/yusuke/samurai

yCrash open source script:
https://github.com/ycrash/ycrash-agent

- - - - - - - - - - - - - -

Read more in this blog:

https://blog.ycrash.io/2022/10/17/sim...

- - - - - - - - - - - - - -

Our Tools:

yCrash: https://yCrash.io/
GCeasy: https://gceasy.io/
HeapHero: https://heaphero.io/
fastThread Tool: https://fastthread.io/

- - - - - - - - - - - - - -

SRE Community:

Need help in troubleshooting your performance problems?
Post here: https://answers.ycrash.io/

- - - - - - - - - - - - - -

Follow us on:

LinkedIn:   / ycrash  
Instagram:   / ycrash_rca  
Facebook:   / tier1app  
Twitter:   / tier1app  

- - - - - - - - - - - - - -

Related videos:

BuggyApp Demo:
   • BuggyApp Demo  

Simulating & troubleshooting OutOfMemoryError in Kotlin:
   • Simulating & troubleshooting OutOfMemoryEr...  

Simulating & troubleshooting StackOverflowError in Kotlin:
   • Simulating & troubleshooting StackOverflow...  

- - - - - - - - - - - - - -

#kotlin | #kotlincoroutines | #contextleakinandroid | #kotlincoroutines example | #kotlincoroutinestutorial | #thread | #activityleakinandroid | #fridgeproblemstroubleshooting | #howtoreducememoryleakinandroid | #learnkotlineasy | #codingtechniquestoavoidmemoryleakinandroid | #anonymousinnerclassesandmemoryleakinandroid | #learnkotlin | #memoryleakinandroid | #howtodetectmemoryleakinandroid | #howtoavoidmemoryleakinandroid | #memoryleak