Skip to main content

//clika-runtime/io.clika.runtime/ClikaRtAndroid/trimOnMemoryPressure

trimOnMemoryPressure

[android]\

@JvmStatic

fun trimOnMemoryPressure(context: Context)

Give the runtime's idle device memory back when the platform asks for memory. Registers ONE listener on the application for the system's memory-pressure signals; when the process reaches the running-low level or any level above it (running-critical, the UI hidden, the app in the background), the runtime releases the memory it keeps cached for reuse on every device it has loaded, so a low-memory phone keeps the app alive instead of killing it. Memory still in use is never touched, and below running-low nothing is released. A second call is a no-op. Call it after load.