From f2fb237212a5df0e525140bfe6206ff7fa46dfef Mon Sep 17 00:00:00 2001 From: Troels Bjerre Lund Date: Wed, 4 Oct 2023 12:21:37 +0200 Subject: [PATCH] [K/N] Lower amount of finalization in stress test --- .../tests/runtime/memory/stress_gc_allocations.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt index 1e6dd13f4b4..43313b3d1da 100644 --- a/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt +++ b/kotlin-native/backend.native/tests/runtime/memory/stress_gc_allocations.kt @@ -52,14 +52,14 @@ fun allocateGarbage() { // Total amount of objects here: // - 1 big object with finalizer // - 9 big objects - // - 9990 small objects with finalizers - // - 90000 small objects without finalizers + // - 2490 small objects with finalizers + // - 97500 small objects without finalizers // And total size is ~50MiB for (i in 0..100_000) { val obj: Any = when { i == 50_000 -> ArrayOfBytesWithFinalizer(1_000_000) // ~1MiB i % 10_000 == 0 -> ArrayOfBytes(1_000_000) // ~1MiB - i % 10 == 0 -> ArrayOfBytesWithFinalizer(((i / 100) % 10) * 80) // ~1-100 pointers + i % 40 == 0 -> ArrayOfBytesWithFinalizer(((i / 100) % 10) * 80) // ~1-100 pointers else -> ArrayOfBytes(((i / 100) % 10) * 80) // ~1-100 pointers } Blackhole.consume(obj)