한국어English日本語简体中文繁體中文DeutschไทยTiếng ViệtРусскийPortuguês (Brasil)EspañolBahasa Indonesia

Game Lag White Paper › L1 Client game process

Client memory leak Client memory leak

Cause ID cg-leak · Primary owner Game team (Client development)

Open the interactive card with figures and simulations →

The longer the game stays open, the more memory it uses; it gets slower and slower until the game is eventually force-closed.

Why Textures, UI, and effects aren’t released when moving between areas → Effect GC runs more often, and the OS runs short of memory and starts swapping → On screen After hours of play it stutters more and more, then gets force-closed (looks like a disconnect to the player)

Symptoms
Stutter, Disconnect
Factors
Stall
Who’s affected
Just me
When
The longer it runs
Owner
Primary owner Game team (Client development)
Game team action items
Measure memory usage at area transitions, find and fix textures, UI, and effects that never get released, run long automated tests (soak tests).
On the graph
Slow climb · Game process memory
Where to look
Record Process(game)\Private Bytes in Performance Monitor for a few hours. On mobile, the exit reason in Android’s ApplicationExitInfo (REASON_LOW_MEMORY) and iOS jetsam reports
Confirmed if
Memory goes up every time the player moves between areas and never comes back down, and stutter and forced shutdowns increase the longer the game runs
Ruled out if
Memory stays flat, and the only thing that grows with uptime is shaking: “Float time precision loss”
Check with
The player’s own environment
Learn more
Phones mostly hold out by compressing memory. If memory still runs short, the OS shuts the game down on the spot (players see it as getting kicked out). Devices with less RAM get shut down first.

Sources

  1. Memory allocation among processes Android (Google)
    Android holds out by compressing memory into zRAM; when that’s not enough, the low memory killer terminates processes, and a foreground app being killed looks like a crash
  2. Identifying high-memory use with jetsam event reports Apple
    iOS force-quits apps (jetsam) when memory pressure doesn’t ease, and any app that exceeds its per-app memory limit becomes a target
  3. Find user-mode memory leaks with Performance Monitor (PerfMon) Microsoft
    Record Process > Private Bytes (private memory allocated by the process) and Virtual Bytes over a long period; if they only ever grow, it’s a leak
  4. ApplicationExitInfo Android (Google)
    REASON_LOW_MEMORY: the system’s low memory killer terminated the app process (devices that don’t support it report REASON_SIGNALED with SIGKILL)

See also

Same layer: L1 Client game process

Same symptom (Stutter), other layers

View the interactive card with figures and simulations