> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# trimMemory

APISummary
Dispatches a memory pressure signal to registered callbacks. Use this to notify Lynx to reclaim resources or apply degradation strategies when the system is under memory pressure.

## Syntax

### Android

```java
@AnyThread
public void trimMemory(@MemoryPressureLevel int pressure);
```

### iOS

```objc
- (void)trimMemory:(LynxMemoryPressureLevel)pressure;
```

### Harmony

```ts
public trimMemory(pressure: MemoryPressureLevel): void;
```

## Parameters

- `pressure`: Memory pressure level, one of `MemoryPressureLevel`.
  - `MEMORY_PRESSURE_LEVEL_NONE`: No problems, enough memory; typically not sent via callback.
  - `MEMORY_PRESSURE_LEVEL_MODERATE`: Free buffers that are cheap to re-allocate and not immediately needed.
  - `MEMORY_PRESSURE_LEVEL_CRITICAL`: Free all possible memory; otherwise the process may be killed by the system, incurring cold start cost.

## Compatibility


**Compatibility Table**
**Query:** `lynx-native-api.lynx-env.trim-memory`

**Platform Support**

| Platform | Version Added | Notes |
|----------|---------------|-------|
| Android | 3.8 | - |
| iOS | 3.8 | - |
| HarmonyOS | 3.8 | - |
| Web | ❌ No | - |
| Clay macOS | ❌ No | - |
| Clay Windows | ❌ No | - |

**Description:** dispatch memory pressure signal to registered callbacks

