any idea why the following : ```fun main() { r...
# coroutines
d
any idea why the following :
Copy code
fun main() {
    repeat(1_000_000) {
        thread {
            Thread.sleep(5000)
            print(".")
        }
    }
}
is not giving an OutOfMemoryError anymore? It was giving it two months ago. Now it is just working a lot more slowly than the coroutines version. I'm using
Android Studio Giraffe | 2022.3.1 Patch 1
+
kotlin-stdlib 1.6.21
The original source code: 7_starting_lots_of_threads.kt
a
Gives OOM in play.kotlinlang.org 🤔
y
I assume you’re not using virtual threads by mistake 🫣 🤣
d
Created a new Android project and tested the same code there - OOM was thrown. Went back to the previous project that was not giving OOM to test again - and this time it was an OutOfMemoryError . Checked the project files, none were changed in any way, git had nothing to commit. So it must be something in my local setup. It feels like a brand new toy has been shown to you and then suddenly taken away. I was already looking forward an investigation.