Why AssetBundle Granularity Matters: Diagnosing Memory Spikes, Remapper Overhead, and PSS Growth in Unity
In a GOT Online report from GameOptim, we noticed that PSS memory spikes significantly in certain scenes. After investigating with Memory Profiler, we found that Remapper memory usage is unusually high. Could this be caused by AssetBundles being split into packages that are too small? https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/8bd8b15b 1652 4380 9e6d 4a6c80ebb1ff.png
The answer is actually the opposite—the issue is not that the AssetBundles are too fragmented, but that they are packaged too broadly. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/0ec61923 1b56 492a a292 d2b854d7ba4a.png By analyzing the PSS memory trend together with the resource lifecycle data, it is possible to quickly identify the source of the memory spike: a key AssetBundle named defaultpackage share assets art prefab scenes.bundle. Whenever this bundle is loaded, memory usage increases dramatically. https://uwa overseas public.oss us east 1.aliyuncs.com/uploads/markdown/443060bc 8099 4b50 8008 84597a0a1e40.png Further investigation through the AssetBundle analysis report reveals several warning signs. The bundle itself is 232 MB, yet it does not contain a large number of typically high volume assets such as textures or meshes. At the same time, in Resource mode, the AssetBundle resource category alone consumes 22 MB of memory. A bundle without substantial mainstream assets exceeding 200 MB strongly suggests issues in resource organization and also helps explain the high Remapper usage observed in Memory Profiler. Based on these findings, the packaging structure of this bundle should be carefully reviewed, focusing on three key questions: 1. Are multiple scenes being packaged into the same AssetBundle? 2. Does the bundle contain a large number of assets that are not actually required by the current scene? 3. Are shared resources assigned improperly, causing dependency aggregation? Based on experience from previous projects, if only the scene that is actually needed is included, memory usage typically does not increase at this scale. Why Does an Oversized AssetBundle Increase Both Remapper and PSS? When multiple scenes are packaged into a single AssetBundle, loading one scene may still cause a large number of unrelated assets and their dependencies to be loaded into memory. At the same time, as the number of objects and dependency relationships within the bundle grows, Unity must maintain larger internal data structures for object mapping and resource reference management. This directly increases Remapper memory usage. Once some of these resources are accessed during runtime, they also contribute to higher PSS memory consumption. As a result, Remapper and PSS often increase together, but they are not equivalent metrics. Remapper reflects the memory overhead associated with Unity's internal object mapping and reference management. PSS Proportional Set Size reflects the actual physical memory consumed by the process. They represent different aspects of the same underlying problem. Optimization Recommendation Control AssetBundle Granularity For scene related content, it is generally recommended to maintain a one scene per bundle strategy whenever possible. This helps avoid loading large amounts of unrelated assets and dependency relationships at once, reducing both memory pressure and Remapper overhead.