코딩Coding/Java&Kotlin

Kotlin Coroutines-debug 예제& 디버깅 Tutorial & 코루틴 가이드

내인생PLUS 2023. 11. 25. 20:46
728x90


디버깅 Tutorial
https://kotlinlang.org/docs/debug-coroutines-with-idea.html#debug-coroutines

Debug coroutines using IntelliJ IDEA – tutorial | Kotlin

kotlinlang.org




메모리 leak?

This text means that the variable's lifetime was decreased, and the variable doesn't exist anymore. It is difficult to debug code with optimized variables because you don't see their values. You can disable this behavior with the -Xdebug compiler option.
Never use this flag in production: -Xdebug can cause memory leaks.


https://youtrack.jetbrains.com/issue/KT-48678/Coroutine-debugger-disable-was-optimised-out-compiler-feature?_gl=1*1dmmmrj*_ga*MTM4ODAyODIwMi4xNzAwOTEyNjYy*_ga_9J976DJZ68*MTcwMDkxMjY2MS4xLjEuMTcwMDkxMzI5NC42MC4wLjA.&_ga=2.9542003.715637141.1700912662-1388028202.1700912662#focus=Comments-27-6015585.0-0

Coroutine debugger: disable "was optimised out" compiler feature : KT-48678

I'm getting "was optimized out" way to often. So I would love a compiler feature that it wouldn't optimize these variables out when in debugging Kotlin. Here's an example: image.png Current workaround My usual workaround is stop the program and re-write my

youtrack.jetbrains.com





https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-debug/

kotlinx-coroutines-debug

Debugging facilities for kotlinx.coroutines on JVM. Overview This module provides a debug JVM agent that allows to track and trace existing coroutines. The main entry point to debug facilities is DebugProbes API. Call to DebugProbes.install installs debug

kotlinlang.org






https://github.com/reactor/BlockHound/blob/1.0.8.RELEASE/docs/quick_start.md




https://kotlinworld.com/381

[Kotlin Coroutines] Log 를 사용한 Coroutines 디버깅

로그를 사용한 디버깅의 필요성 Kotlin Coroutines는 같은 Coroutine Builder(launch, async 등) 의 중괄호 내부의 코드들이 다른 스레드에서 실행될 수 있다. 예를 들어 아래 코드에서 "task1 : start" 는 메인 스

kotlinworld.com




https://12bme.tistory.com/582

[kotlin] 코틀린의 코루틴 가이드(1)

코틀린 코루틴 가이드를 잘 번역해주신 블로그입니다. 아래 블로그 내용으로 공부를 해서 원본 내용은 아래 링크 참고 바랍니다. https://medium.com/@myungpyo/reading-coroutine-official-guide-thoroughly-part-0-2017

12bme.tistory.com





https://stackoverflow.com/questions/59345012/kotlin-android-how-to-debug-coroutines-correctly

Kotlin, Android, how to debug coroutines correctly?

I'm trying to debug my coroutines, and breakpoints placed into suspend function don't work. Pls help me understand why. Working with Android Studio. Ok, I launch a coroutine from viewModelScope:

stackoverflow.com




다른글 보기
코틀린 문법 총 정리 - https://economiceco.tistory.com/m/19102

코틀린 문법 총 정리

https://youtu.be/OtHkb6wAI5U?si=Qr1DbF3g2bEArqAX 코틀린 철학 알아보기 코드스피츠90 - 코틀린 언어편 1회차 | 코드스피츠 https://youtu.be/1OzBh2Uuj2s?si=DD_lptSyKvJ5FEJN 영상 모아보기 https://youtube.com/playlist?list=PLBNdLLa

economiceco.tistory.com

















반응형