The “coroutines are lightweight” example will prod...
# coroutines
l
The “coroutines are lightweight” example will produce a OutOfMemory Exception in the kotlin playground. Is there something special about the playground or did something change in regard to how coroutines https://pl.kotl.in/SysF9E09m
Copy code
import kotlinx.coroutines.*
    
fun main() = runBlocking {
    repeat(100_000) { // launch a lot of coroutines
        launch {
            delay(1000L)
            print(".")
        }
    }
}
🤣 3
It works with 50k. So I guess the containers are just too constrained in terms of memory resources (which totally makes sense) so the GC work is too high to clean it up
e
Just very limited in memory
👍 1