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
lukaswelte
10/12/2018, 3:18 PM
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