targetHeapBytes

Total amount of heap available for Kotlin objects. The GC tries to schedule execution so that Kotlin heap doesn't overflow this heap. Automatically adjusts when autotune is true: after each collection the targetHeapBytes is set to heapBytes / targetHeapUtilization and capped between minHeapBytes and maxHeapBytes, where heapBytes is heap usage after the garbage is collected. Note, that if after a collection heapBytes targetHeapBytes (which may happen if autotune is false, or maxHeapBytes is set too low), the next collection will be triggered almost immediately.

Default: 100 MiB (10 MiB on watchOS)

Since Kotlin

1.9

Throws

when value is negative.