RAM Optimization in Games: From Audit to Implementation
A crash without warning on devices with 3 GB RAM is not a coincidence. In our practice, every second project encounters Unity memory leaks. iOS and Android silently accumulate memory pressure until the system kills the process with SIGKILL — no log, no stack trace. Developers often blame "engine instability," but the real cause is uncontrolled heap growth in Mono/IL2CPP and untimely asset unloading. We guarantee that analysis with Memory Profiler reveals the true sources of leaks, not just surface-level indicators.
The problem is that the Unity Memory Profiler often shows "everything is fine" — 400 MB seems non-critical. But native memory held by Texture2D objects without explicit references is not visible there. You need Total System Memory from the Profiler window, not just Managed Heap. Our experience shows that ignoring this leads to crashes during testing.
Why Does the Standard Profiler Not Show the Full Picture?
The Unity Memory Profiler (com.unity.memoryprofiler) takes snapshots, but its Managed Heap often does not reflect real native resource consumption. Textures, shaders, AudioClip — all live outside the C# heap. We use Compare Snapshots at multiple session points: after startup, after scene load, mid-gameplay, after scene change. Only this shows objects growing from snapshot to snapshot. This is a proven method developed over 7 years of optimizations (see Unity Memory Profiler documentation).
Three Sources of Leaks We Find in Every Second Project
Unclosed AssetBundle references. A developer loads an AssetBundle, extracts a sprite, but never calls bundle.Unload(false). The sprite stays in memory. Even after the sprite is destroyed, the native Texture2D object is still retained via a WeakReference in ResourceManager. After 10 location loads/unloads, memory is not reclaimed. This is classic Unity native heap fragmentation. Solution: switch to Addressables with explicit lifetime management via AsyncOperationHandle.Release(). Addressables are better than Resources: they give explicit control and reduce peak consumption by 2–3 times.
Texture duplication on scene changes. When transitioning between scenes using SceneManager.LoadScene with LoadSceneMode.Single, the old scene is unloaded. But if the new scene has textures with the same names loaded via Resources.Load in code, they may appear in memory twice until Resources.UnloadUnusedAssets() is called. On projects with heavy scenes (100+ MB textures), this causes a memory peak at the transition moment — exactly when crashes occur. Savings after fixing: up to $2000 per month on cloud testing by reducing the number of restarts.
AudioClip with incorrect Load Type settings. AudioClip with Load Type = Decompress On Load decompresses PCM into memory on loading and keeps it there. For a long music track, this can be 50–80 MB for just one clip. Rule: music → Streaming, short SFX → Compressed In Memory, critical low-latency SFX → Decompress On Load only if length < 2 seconds. This approach ensures stable performance on devices with 2 GB RAM.
| Load Type |
Use Case |
Memory |
Latency |
| Decompress On Load |
Short SFX |
High |
Low |
| Compressed In Memory |
Medium sounds |
Medium |
Medium |
| Streaming |
Music, long clips |
Low |
High |
How Addressables Solve the Duplication Problem?
Switching from Resources to Addressables gives explicit control over asset lifetime. AssetReference + LoadAssetAsync + Release — full cycle without "magic." We configure memory profiles via Addressables Analyze: Check Duplicate Bundle Dependencies finds assets packed into multiple bundles simultaneously (a typical cause of duplication). In one project, this reduced peak consumption from 847 MB to 480 MB on an iPhone 8 (see case below).
Case from practice: a mobile action game with 9 levels. After completing 3 levels in a row, the game crashed on iPhone 8. Memory Profiler showed 847 MB at the start of level 4. Source — 12 unique UI atlases loaded via Resources.Load in the Lobby scene, not unloaded between levels. After migrating to Addressables with explicit Release when entering the game scene and Resources.UnloadUnusedAssets in a coroutine, the peak dropped to 480 MB. Savings amounted to $1500 per month on the device farm.
Object pooling instead of Instantiate/Destroy. Each Instantiate allocates new memory, each Destroy does not return it immediately — GC Alloc accumulates. ObjectPool<T> from Unity 2021 LTS completely eliminates this category of allocations for projectiles, enemies, VFX. Comparison: with 1000 spawns, pooling gives zero allocations, while Instantiate/Destroy spends 10+ MB on GC.
What Is Included in Our Work?
- Audit of current memory state with Memory Profiler snapshots on the target device
- Detailed report with top-10 leak sources and priorities
- Implementation of fixes: Addressables, object pooling, AudioClip optimization, AssetBundle fixes
- Repeated load testing (1 hour without restart)
- Team training: Profiler usage, Addressables, best practices
-
Result guarantee: stability on devices with 3 GB RAM — written commitment
Our team has 7+ years in game dev, over 50 optimization projects for iOS and Android. We work turnkey — from audit to implementation.
Work Stages
- Capture baseline metrics via Profiler on target device (not Editor)
- Series of Memory Profiler snapshots across the game cycle
- Analyze top-10 objects by memory consumption
- Identify leak sources via Compare Snapshots
- Prioritize by impact: textures → AudioClip → Managed Heap → pooling
- Implement fixes with intermediate measurements
- Load testing: 1 hour game session without restart
| Task Scale |
Estimated Timeline |
| Memory audit + report |
2–4 days |
| Fix 2–3 specific leak sources |
1–2 weeks |
| Resources → Addressables migration + optimization |
3–6 weeks |
| Full architectural rework of asset management |
6–12 weeks |
Contact us for a consultation. If your game crashes on older devices, get an audit in 2 days and discover the real leak sources. Order a memory audit today — we'll assess your project within 24 hours.
What Are the Typical Game Performance Problems and How Optimization Solves Them?
A project runs smoothly on developer devices. On a five-year-old mid-range Android, it hits 20 fps and overheats after five minutes. On iPhone 11 it maintains 60 fps, but on iPhone XR it drops in heavy scenes. We encounter this every day. Optimization is not a later task—it is an architectural decision from the first commit. With eight years of experience, we have optimized over fifty games, from hypercasual to AAA on consoles. We guarantee: after our audit, you get not just a list of problems, but a concrete plan with measurable goals and deadlines. Order a performance audit — we evaluate your project in three days and show how to reduce draw calls by 40% without losing quality.
How to Profile Game Performance? Tools and Best Practices
Before any optimization, measure. Optimization without profiling is guesswork.
| Tool |
Purpose |
| Unity Profiler |
CPU/GPU time per system, GC allocations, audio |
| Frame Debugger |
Inspect each draw call in a frame |
| Memory Profiler |
Memory snapshot, asset dependency graph |
| RenderDoc |
Deep GPU state analysis, relevant for PC/Console |
| Android GPU Inspector |
GPU profiling on real Android devices |
| Xcode Instruments |
GPU + memory on iOS (Metal Performance HUD) |
| Snapdragon Profiler |
Qualcomm GPU—detailed shader statistics |
Profile on target hardware, not in the editor. The editor adds overhead — Play Mode numbers are not representative. Distinguish between GPU and CPU bottlenecks: CPU may cause many draw calls or heavy logic, GPU may have complex shaders or overdraw. Unity Documentation: profiling on device is mandatory for mobile games. Typical profiling time for one scenario is five to eight hours, including metrics collection on three to five devices of different generations.
Additional profiling tips
- Use the Profiler Capture tool with deep profile only when needed – it adds up to 50% overhead.
- Run at least three captures per scenario to get reliable averages.
- Record timeline markers for custom systems (AI, animation, network) to correlate spikes.
How Does Game Performance Optimization Reduce Draw Calls? Static Batching to SRP Batcher
A draw call is a command from CPU to GPU to “draw this.” Each call has overhead regardless of geometry complexity. On mobile, 200–300 draw calls per frame is typical. The goal is to minimize their number by combining geometry that shares the same material.
Static Batching combines stationary meshes during build. Requirement: Static flag on objects and the same material. Effective for static environments but increases memory usage – the combined mesh is stored separately. In scenes with thousands of static objects, monitor memory via Memory Profiler.
Dynamic Batching combines meshes at runtime with strict limits: fewer than 900 vertex attributes per mesh, same material and scale. In practice, it works only for small objects (particles, UI). Disabled by default in URP – replaced by SRP Batcher.
SRP Batcher is not classic batching – it optimizes CPU overhead when preparing draw calls. Instead of reloading shader uniform data each frame, SRP Batcher caches it in GPU memory and updates only when changed. Draw calls remain the same in number, but each takes less CPU time – sometimes 2–3 times less on render CPU time compared to standard batching. Requirement: shader must be compatible with SRP Batcher (declare per-object properties in UnityPerDraw CBUFFER). Standard URP Lit/Unlit shaders are compatible. Custom ones – check in Material Inspector: SRP Batcher compatible: Yes/No. To enable, ensure the SRP Batcher option is active in URP Asset, and for custom shaders use UNITY_INSTANCING_BUFFER macro and declare per-object properties in CBUFFER_START(UnityPerDraw). After enabling, the RenderLoop.Draw CPU time should decrease in Profiler.
GPU Instancing is for many copies of the same mesh with the same material (trees, grass, NPCs). It sends one draw call with an array of per-instance data. Enable on material: Enable GPU Instancing. Limitation: all instances in one batch must have the same material and mesh. Graphics.DrawMeshInstanced / Graphics.DrawMeshInstancedIndirect enable procedural rendering without GameObject overhead.
The choice of method depends on scenario. Static Batching for static environments. SRP Batcher wins in projects with many unique materials. GPU Instancing is indispensable for mass objects (forests, crowds). Dynamic Batching only for small and rare cases. In practice, we combine all methods, starting with profiling.
| Method |
Object Type |
CPU Impact |
GPU Impact |
RAM Consumption |
| Static Batching |
Static |
Moderate reduction |
No change |
Increases |
| Dynamic Batching |
Small (≤900 verts) |
Reduction |
No change |
No change |
| SRP Batcher |
Any (compatible shaders) |
Significant reduction (2–3×) |
No change |
No change |
| GPU Instancing |
Copies of same mesh |
Minimal |
Significant reduction |
Slight |
For more details on the technology, see Geometry instancing (Wikipedia).
Why Is Memory Optimization Critical for Mobile Games?
Mobile platforms have strict RAM limits. iOS kills apps without warning on memory pressure. Android does similarly with onLowMemory callback. Target budgets: iOS <1 GB for modern devices, <512 MB for iPhone 8/X support; Android <800 MB for broad compatibility (OS uses 400–600 MB). Typical savings after our optimization are 30–50% of RAM while maintaining quality.
Addressables and Asset Bundles: How to Stay Within Budget
Loading everything at startup is unacceptable for large projects. Addressables (a wrapper over Asset Bundles) provide addressable asynchronous asset loading. Explicit unload: Addressables.ReleaseInstance / Addressables.Release. Addressables do not automatically unload assets when objects are destroyed. A common mistake: Addressables.InstantiateAsync in a loop without Release – memory grows until crash. Reference counting: an asset is unloaded only when all its handles are freed. Architectural pattern: a service/manager holds the handle of the loaded asset and releases it during scene transitions.
Groups and Bundle Strategy: group assets by loading logic. For example, all assets of one level in one bundle, shared assets (UI, fonts) in a separate group with Prevent Updates. This strategy saves up to 30% memory.
Texture Memory: Where 70% of RAM Comes From
Textures are the main memory consumer. Analyze via Memory Profiler: All Of Memory -> Texture2D shows the heaviest textures immediately. In practice, we find textures with inflated Max Size (4096 for a mobile icon is a typical mistake). Measures: Mipmap for 3D textures (enable), for UI (disable); Streaming Mipmaps for open world – loads mip levels as camera approaches. A common problem: textures referenced by unused Materials remain in memory – Memory Profiler shows the reference chain. Remove unnecessary materials. After replacing all RGBA32 textures with ASTC 6×6 on Android, savings reach 60% without quality loss.
GC Allocations: How to Eliminate Freezes in Hot Path
C# garbage collector in Unity is stop-the-world. If heap memory is allocated per frame, GC pause causes visible freezes. Goal: zero allocations in hot path (Update, FixedUpdate, render). Typical sources: string concatenation in Update (replace with StringBuilder); LINQ in hot path (manual loops with pre-allocated lists); GetComponent<T>() every frame (cache in Awake/Start); boxing value types when passed as object parameters. After profiling with Unity Profiler, we reduce hot path allocations by 95% – freezes disappear.
How Can LOD and Culling Cut 40% of Draw Calls?
LOD Group switches to simplified geometry as the object moves away from camera. Standard for 3D environment: LOD0 (100% triangles), LOD1 (30–50%), LOD2 (10–15%), Culled. For mobile, set Culled threshold more aggressively – draw less per frame.
Occlusion Culling – Unity does not render objects behind walls. Requires baked occlusion data. For indoor scenes, reduces draw calls by 20–40%.
Frustum Culling works automatically – objects outside camera FOV are not rendered. But the draw call for the check still happens. For scenes with thousands of objects, use custom spatial partitioning (Quadtree, Octree). In one of our projects, implementing occlusion culling and LOD reduced total draw calls from 2800 to 450 on Android.
How to Maintain 72 FPS on Quest 3 with VR Optimization?
VR is a separate class of tasks. Frame rate of 72 or 90 Hz must not be violated, or motion sickness occurs. In addition to standard methods: Single Pass Instanced Rendering – renders both eyes in one pass (halves draw calls); Fixed Foveated Rendering (Quest) – reduces peripheral resolution; Late Latching (Quest 3) – updates controller position as late as possible before rendering; Dynamic Resolution in URP/HDRP – automatically lowers render resolution on fps drops. For Quest, profile via OVR Metrics Tool – displays CPU/GPU time directly in headset. After applying these methods, frame rate on Quest 2 stabilizes at 72 FPS even in scenes with 1.5 million polygons.
What Deliverables Do You Get from Game Performance Optimization? Stages and Timelines
We offer a comprehensive turnkey service. Here is exactly what you receive:
-
Profiling report on target devices – metrics (FPS, draw calls, memory, GC) for 5–7 main scenarios. Delivery: 3–5 business days.
-
Priority action plan – which problems are critical, which can be deferred. Priorities based on impact on gaming experience.
-
Optimization implementation – batching, LOD, Addressables, shaders, occlusion culling. Average implementation cycle: 2–4 weeks.
-
Re-profiling results – measured improvements. Typical FPS increase: 30–60% on mobile devices.
-
Documentation – recommendations for maintenance and further development.
-
Team training – how to prevent regressions. We conduct workshops on profiling and optimization.
Get a consultation – we evaluate your project for free and show the optimization potential. Contact us to learn exact timelines and details for your stack.