Skip to content
ToanLB
Go back

Does a 150MB Mobile Game Really Need Addressables? The Direct Reference Illusion and the RAM Reality

~11 min read
Does a 150MB Mobile Game Really Need Addressables? The Direct Reference Illusion and the RAM Reality

When evaluating Addressables for mobile productions, a perennial question arises: “Our project is small to medium scale, with an install size of only 100MB to 150MB. Do we really need the architectural overhead of Addressables?”.

Many developers reflexively dismiss the idea: “The game is tiny. Dragging prefabs into the Scene or dropping them in Resources is far simpler. Why bother with bundle schemas, catalogs, and async tasks?”.

At first glance, this perspective seems pragmatic. But in commercial mobile development, reality is rarely black and white. Judging resource requirements strictly by a 150MB binary size on disk blinds teams to a common mobile hazard: A 150MB installation package that balloons to over 700MB of native RAM at runtime, resulting in sudden termination by the operating system.

Why does a lightweight installation consume so much memory? Where is the technical line between disk footprints and runtime memory footprints? And if you do not plan remote hot patching, does pure Local Addressables provide tangible engineering value?


1. The Direct Reference Illusion: Disk Size vs Runtime RAM

This is the most deceptive misconception in Unity asset management:

Conflating Disk Footprints with Runtime Memory Footprints

A 150MB APK or AAB represents compressed Disk Size. It achieves that compact footprint through modern compression pipelines:

However, once the user boots the application on a physical phone, the execution model shifts completely:

flowchart LR
    subgraph DIRECT["1. Direct References: Inspector Drag-and-Drop"]
        direction TB
        D1["Main Menu Scene Boots"]
        D2["Pulls All Modal Prefabs Implicitly"]
        D3["Native RAM Balloons to 700MB"]
        D1 --> D2 --> D3
    end

    subgraph ONDEMAND["2. Pure Local Addressables: On-Demand"]
        direction TB
        A1["Main Menu Scene Boots Cleanly"]
        A2["Open Shop Streams Target Bundle"]
        A3["Close Shop Releases RAM Instantly"]
        A1 --> A2 --> A3
    end

    DIRECT -.->|"Architectural Lifecycle Divergence"| ONDEMAND

The Invisible Direct Reference Graph

Consider how menus are commonly constructed in early development:

  1. Create a UIManager GameObject in the Main Menu Scene.
  2. In the Inspector, expose fields: [SerializeField] GameObject popupShopPrefab;, [SerializeField] GameObject popupGachaPrefab;, [SerializeField] GameObject popupRankingPrefab;…
  3. Drag dozens of prefabs from the Project pane into these slots.

When Unity loads the menu scene via SceneManager.LoadScene:

The player has barely loaded into the title screen. They have not clicked “Shop” or “Gacha”. Yet every asset required by those systems sits resident in native RAM!

Three Hidden Native RAM Multipliers

Native RAM consumption is further amplified by three frequently overlooked Editor import settings:

  1. Texture Mipmaps: For 2D UI sprites, enabling Generate Mip Maps generates downscaled image pyramids, adding approximately 33% (1/3) redundant RAM per image.
  2. Read/Write Enabled: Checking Read/Write Enabled forces Unity to maintain duplicate copies: one in GPU VRAM and a secondary mirror in CPU system RAM, doubling memory consumption (100% overhead).
  3. AudioClip Decompress On Load: Multi-minute background music tracks set to Decompress On Load force Unity to decompress MP3/OGG streams into raw PCM audio arrays in memory. A 3MB compressed file can expand into 40MB to 60MB of native RAM!

Combined, a modest 150MB download can easily balloon into a 500MB to 700MB native memory footprint right at the title screen!


2. Low Memory Killer (LMK): Why Games Crash Without Exceptions

What happens when RAM swells on consumer mobile hardware?

Players on budget Android devices (equipped with 2GB to 3GB of total system RAM) report instant game crashes shortly after launching the title. When inspecting crash reporting dashboards (Firebase Crashlytics, Bugsnag), engineers find zero recorded C# exceptions or null references.

The silent executioner is Android’s kernel daemon: the Low Memory Killer (lmkd):

[Android OS Kernel Architecture]
When available physical memory breaches critical thresholds:
1. Android OS emits onTrimMemory (TRIM_MEMORY_RUNNING_CRITICAL)
2. If application fails to evict native allocations immediately
3. lmkd sends SIGKILL (kill -9) terminating the process instantly
  1. Kernel Mechanics: Mobile devices lack unlimited swap partitions. When overall system memory breaches critical reserves, the kernel invokes lmkd to terminate background and foreground apps exceeding memory quotas.
  2. No Post-Mortem Hook: LMK kills processes via kernel-level SIGKILL (kill -9). The Mono/IL2CPP runtime terminates instantly without executing catch or finally blocks, completely unable to transmit crash telemetry.
  3. Identifying the Culprit: To diagnose LMK crashes, connect the hardware device via USB and observe Android Debug Bridge logs:
    adb logcat | grep -iE "lowmemorykiller|lmkd"
    If you find system logs indicating the game was terminated due to memory pressure, the crash stems from excessive native memory allocation.

3. Addressables for a 150MB Project: The Value of Pure Local Mode

Developers frequently assume: “Addressables requires setting up CDN servers, patch pipelines, and managing cellular network downloads”.

This is incorrect. For a 150MB mobile game, you can operate Addressables in Pure Local Mode:

What is the core architectural value of Pure Local Addressables?

1. Breaking the Direct Reference Graph

Instead of dragging heavy prefabs into the Inspector, managers store lightweight AssetReferenceGameObject fields (GUID strings consuming mere bytes). When the Scene boots, Unity avoids loading UI textures or audio clips into RAM.

2. Enforcing On-Demand Lifecycles: Stream and Purge on Demand

3. Blazing Fast Startup Times

Because the Main Menu Scene does not pull in an extensive reference tree, boot time drops from multiple seconds down to hundreds of milliseconds.


4. Production Code: Refactoring Direct References to On-Demand Popups

In a midcore mobile RPG featuring over 20 distinct modal screens (Shop, Gacha, Leaderboards, Inventory, Hero Codex), direct Inspector references caused the main menu to consume 650MB of native RAM on 2GB devices, triggering frequent lmkd terminations.

Legacy Approach: Direct References Pinning Memory

In the naive implementation, all prefabs were statically bound in the Inspector of LegacyPopupManager:

using UnityEngine;

public class LegacyPopupManager : MonoBehaviour
{
    [SerializeField] private GameObject _shopPopupPrefab;
    [SerializeField] private GameObject _gachaPopupPrefab;
    [SerializeField] private GameObject _inventoryPopupPrefab;

    private GameObject _activeShopInstance;

    // Textures, materials, and audio for all 3 popups 
    // are loaded into native RAM the moment this Scene wakes up!
    public void OpenShop()
    {
        if (_activeShopInstance == null)
        {
            _activeShopInstance = Instantiate(_shopPopupPrefab, transform);
        }
    }

    public void CloseShop()
    {
        if (_activeShopInstance != null)
        {
            // Destroy only removes the GameObject from the Scene hierarchy.
            // Source prefabs and textures remain pinned in RAM!
            Destroy(_activeShopInstance);
            _activeShopInstance = null;
        }
    }
}

Production Architecture: On-Demand Pure Local Addressables Loader

We refactor references into AssetReferenceGameObject, implement re-entrancy guards, and pass cancellation tokens:

using System;
using System.Threading;
using System.Threading.Tasks;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.ResourceManagement.AsyncOperations;

public class AddressablesPopupLoader : MonoBehaviour
{
    [SerializeField] private AssetReferenceGameObject _shopPopupReference;

    private GameObject _loadedPopupInstance;
    private bool _isLoading;

    public async Task<bool> OpenPopupAsync(CancellationToken cancellationToken = default)
    {
        if (_loadedPopupInstance != null)
        {
            _loadedPopupInstance.SetActive(true);
            return true;
        }

        if (_isLoading) return false;
        _isLoading = true;

        AsyncOperationHandle<GameObject> handle = default;
        try
        {
            handle = _shopPopupReference.InstantiateAsync(transform);
            await handle.Task;

            if (cancellationToken.IsCancellationRequested)
            {
                if (handle.IsValid() && handle.Status == AsyncOperationStatus.Succeeded && handle.Result != null)
                {
                    _shopPopupReference.ReleaseInstance(handle.Result);
                }
                return false;
            }

            if (handle.Status == AsyncOperationStatus.Succeeded)
            {
                _loadedPopupInstance = handle.Result;
                return true;
            }

            return false;
        }
        catch (OperationCanceledException)
        {
            if (handle.IsValid() && handle.Status == AsyncOperationStatus.Succeeded && handle.Result != null)
            {
                _shopPopupReference.ReleaseInstance(handle.Result);
            }
            return false;
        }
        finally
        {
            _isLoading = false;
        }
    }

    public void CloseAndReleasePopup()
    {
        if (_loadedPopupInstance != null)
        {
            _shopPopupReference.ReleaseInstance(_loadedPopupInstance);
            _loadedPopupInstance = null;
        }
    }

    private void OnDestroy()
    {
        CloseAndReleasePopup();
    }
}

Pure C# Memory Simulation and Automated Unit Tests

To verify memory allocation and reclamation mechanics without Unity Editor overhead, we model reference counting in pure C#:

using System.Collections.Generic;
using NUnit.Framework;

public class MockPopupAsset
{
    public string Name { get; set; }
    public long NativeRamBytes { get; set; }
}

public class MemoryFootprintSimulator
{
    public long CurrentAllocatedBytes { get; private set; }
    private readonly Dictionary<string, int> _refCounts = new();

    public void LoadAsset(MockPopupAsset asset)
    {
        if (!_refCounts.ContainsKey(asset.Name))
        {
            _refCounts[asset.Name] = 1;
            CurrentAllocatedBytes += asset.NativeRamBytes;
        }
        else
        {
            _refCounts[asset.Name]++;
        }
    }

    public void UnloadAsset(MockPopupAsset asset)
    {
        if (_refCounts.TryGetValue(asset.Name, out int count))
        {
            if (count <= 1)
            {
                _refCounts.Remove(asset.Name);
                CurrentAllocatedBytes -= asset.NativeRamBytes;
            }
            else
            {
                _refCounts[asset.Name] = count - 1;
            }
        }
    }

    public int GetRefCount(string assetName) => _refCounts.TryGetValue(assetName, out int count) ? count : 0;
}

[TestFixture]
public class MobileMemoryArchitectureTests
{
    private MockPopupAsset _shopPopup;
    private MockPopupAsset _gachaPopup;
    private MockPopupAsset _inventoryPopup;

    [SetUp]
    public void Setup()
    {
        _shopPopup = new MockPopupAsset { Name = "Popup_Shop", NativeRamBytes = 45_000_000 };
        _gachaPopup = new MockPopupAsset { Name = "Popup_Gacha", NativeRamBytes = 60_000_000 };
        _inventoryPopup = new MockPopupAsset { Name = "Popup_Inv", NativeRamBytes = 35_000_000 };
    }

    [Test]
    public void DirectReference_WhenSceneBooted_AllocatesAllAssetsImmediately()
    {
        var memoryTracker = new MemoryFootprintSimulator();

        // Direct references allocate all assets upfront during scene load
        memoryTracker.LoadAsset(_shopPopup);
        memoryTracker.LoadAsset(_gachaPopup);
        memoryTracker.LoadAsset(_inventoryPopup);

        Assert.AreEqual(140_000_000, memoryTracker.CurrentAllocatedBytes, 
            "Direct References allocate entire dependency tree upon Scene awaken.");
    }

    [Test]
    public void AddressablesOnDemand_WhenSceneBooted_AllocatesZeroBytes()
    {
        var memoryTracker = new MemoryFootprintSimulator();

        // On boot, Addressables only holds lightweight AssetReference GUIDs
        Assert.AreEqual(0, memoryTracker.CurrentAllocatedBytes, 
            "Pure Local Addressables maintains zero memory allocation on Scene startup.");
    }

    [Test]
    public void AddressablesOnDemand_WhenPopupOpenedAndClosed_ReclaimsAllNativeRam()
    {
        var memoryTracker = new MemoryFootprintSimulator();

        // 1. Open popup: allocates 45MB
        memoryTracker.LoadAsset(_shopPopup);
        Assert.AreEqual(45_000_000, memoryTracker.CurrentAllocatedBytes);

        // 2. Close popup: evicts 45MB
        memoryTracker.UnloadAsset(_shopPopup);
        Assert.AreEqual(0, memoryTracker.CurrentAllocatedBytes, 
            "Closing popup reclaims all allocated native RAM.");
    }

    [Test]
    public void AddressablesOnDemand_WhenSpamClicked_DoesNotDoubleAllocate()
    {
        var memoryTracker = new MemoryFootprintSimulator();

        memoryTracker.LoadAsset(_shopPopup);
        memoryTracker.LoadAsset(_shopPopup);
        memoryTracker.LoadAsset(_shopPopup);

        Assert.AreEqual(45_000_000, memoryTracker.CurrentAllocatedBytes, 
            "Proper handle tracking prevents duplicate memory allocation under spam clicks.");
    }

    [Test]
    public void AddressablesOnDemand_WhenMultipleReferencesOpen_OnlyFreesRamWhenRefCountReachesZero()
    {
        var memoryTracker = new MemoryFootprintSimulator();

        memoryTracker.LoadAsset(_shopPopup);
        memoryTracker.LoadAsset(_shopPopup);
        Assert.AreEqual(45_000_000, memoryTracker.CurrentAllocatedBytes);
        Assert.AreEqual(2, memoryTracker.GetRefCount(_shopPopup.Name));

        // First caller releases; RAM remains pinned
        memoryTracker.UnloadAsset(_shopPopup);
        Assert.AreEqual(45_000_000, memoryTracker.CurrentAllocatedBytes);

        // Final caller releases; RAM completely evicted
        memoryTracker.UnloadAsset(_shopPopup);
        Assert.AreEqual(0, memoryTracker.CurrentAllocatedBytes);
    }
}

5. Architectural Decision Tree: When Does a 150MB Game Need Addressables?

To prevent dogmatic over-engineering, use this decision framework based on genre requirements and team constraints:

flowchart TD
    START{"Game Binary Size: ~150MB"}

    START -->|"Simple Gameplay / Short Loop"| HC["Hyper-Casual / 1-2 Scene Mini-games"]
    HC -->|"Characteristics"| HC_DETAIL["Minimal total assets; peak RAM < 200MB<br/>Rapid 2-4 week MVP schedule"]
    HC_DETAIL --> ACTION_NO["NO ADDRESSABLES REQUIRED<br/>• Partition small Scenes logically<br/>• Transition via LoadSceneMode.Single<br/>• Call UnloadUnusedAssets if Additive"]

    START -->|"Complex Feature Sets"| MC["Midcore, Puzzle, RPG with Multiple Modals"]
    MC -->|"Characteristics"| MC_DETAIL["Dozens of UI Popups, Skins, VFX, BGM<br/>Live-ops content expansion planned"]
    MC_DETAIL --> ACTION_YES["USE PURE LOCAL ADDRESSABLES<br/>• Break Direct Reference Graph<br/>• Stream & Purge On-Demand per modal<br/>• Migrate to Remote later without code rewrites"]

When Addressables is NOT Required:

When Addressables IS Mandatory (Even at 150MB):

  1. Prolific UI Modals and Heavy Audio: If the title hosts complex shops, gacha animations, hero skins, and high-quality audio tracks, Pure Local Addressables is the primary mechanism preventing peak RAM from exceeding 250MB.
  2. Long-Term Live-Ops Roadmap: Adopting AssetReference early is an invaluable architectural investment. When the time comes to offload stage packages to CDN servers to trim initial download sizes from 150MB down to 80MB, you simply adjust Group schemas in the Addressables window without modifying a single line of gameplay code!

6. Architectural Trade-off Matrix

CriteriaDirect References (Inspector)Pure Local Addressables (StreamingAssets)
Initial Implementation ComplexityTrivial; single synchronous InstantiateModerate; requires async/await or UniTask
First Scene Boot TimeSlow; deserializes entire reference graphInstant; startup scene is completely clean
Runtime Native RAM FootprintBloated; pre-loads unused modal assetsMinimal; allocates strictly active visuals
LMK Crash Risk on Low-End AndroidHigh if project has rich UI/texturesNear Zero; smooth on-demand streaming
Memory Lifecycle DisciplineMinimal; reliant on Scene unloadsHigh; requires disciplined ReleaseInstance calls
Readiness for CDN Live-ops MigrationRequires complete loading architecture rewriteSeamless toggle from Local to Remote

7. Production Takeaways


Share this post:
Lương Bảo Toàn

Luong Bao Toan

I work in HMI Automotive and Game development, sharing knowledge, hands-on experience, and stories I find interesting throughout my journey.

Did this article bring you value?

If this article helped your work, or you simply enjoyed it and want to support me, you can

Buy me a coffee

Related Articles

Comments & Discussions

Powered by Giscus

Get New Posts via Email

Subscribe to stay updated and never miss new posts from me.

* No spam. You can unsubscribe at any time with a single click.