---
title: "trimOnMemoryPressure"
sidebar_label: "trimOnMemoryPressure"
description: "Kotlin binding reference: trimOnMemoryPressure."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.runtime](../index.md)/[ClikaRtAndroid](index.md)/[trimOnMemoryPressure](trimOnMemoryPressure.md)

# trimOnMemoryPressure

[android]\

@[JvmStatic](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.jvm/-jvm-static/index.html)

fun [trimOnMemoryPressure](trimOnMemoryPressure.md)(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](load.md).