<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Tim</title>
    <description>The latest articles on DEV Community by Tim (@simontang).</description>
    <link>https://dev.to/simontang</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4011780%2Fd83d2ca4-3bc7-4bb1-aa7f-9c59d3d644c2.png</url>
      <title>DEV Community: Tim</title>
      <link>https://dev.to/simontang</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/simontang"/>
    <language>en</language>
    <item>
      <title>The Hidden Reason Your Unity Build Is Bigger Than It Should Be (Addressables Duplicate Dependencies)</title>
      <dc:creator>Tim</dc:creator>
      <pubDate>Thu, 02 Jul 2026 09:22:21 +0000</pubDate>
      <link>https://dev.to/simontang/the-hidden-reason-your-unity-build-is-bigger-than-it-should-be-addressables-duplicate-dependencies-2ndo</link>
      <guid>https://dev.to/simontang/the-hidden-reason-your-unity-build-is-bigger-than-it-should-be-addressables-duplicate-dependencies-2ndo</guid>
      <description>&lt;p&gt;After 17 years of shipping Unity projects, I can tell you where the mystery megabytes in your build usually hide: &lt;strong&gt;the same assets are being packed into more than one bundle, silently.&lt;/strong&gt; Addressables does this by design, and it's one of the most common — and most invisible — sources of wasted space in a shipped game.&lt;/p&gt;

&lt;p&gt;This post covers &lt;strong&gt;why&lt;/strong&gt; duplication happens, &lt;strong&gt;how&lt;/strong&gt; to find and fix it with Unity's built-in Analyze tool, and the &lt;strong&gt;false-positive trap&lt;/strong&gt; that makes the automatic fix do the wrong thing if you're not careful. (That last part bit me hard, which is half the reason this post exists.)&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Addressables duplicates assets
&lt;/h2&gt;

&lt;p&gt;Duplication comes from &lt;strong&gt;implicit dependencies&lt;/strong&gt;. When you mark an asset as Addressable, you make it &lt;em&gt;explicit&lt;/em&gt;. But anything that asset references — materials, textures, meshes, shaders — comes along &lt;em&gt;implicitly&lt;/em&gt;, even if you never added it to a group yourself.&lt;/p&gt;

&lt;p&gt;The problem starts when two explicit Addressables in &lt;strong&gt;different groups&lt;/strong&gt; share the same implicit dependency. The classic example: two prefabs in two different groups both reference the same material. That material — and everything &lt;em&gt;it&lt;/em&gt; depends on — gets pulled into &lt;strong&gt;both&lt;/strong&gt; bundles.&lt;/p&gt;

&lt;p&gt;The cost shows up twice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;On disk:&lt;/strong&gt; the dependency is stored once per bundle, inflating your total download/build size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In memory at runtime:&lt;/strong&gt; if both bundles are loaded, you get &lt;strong&gt;two separate copies&lt;/strong&gt; of the asset, each with its own instance identity. This is worse than just wasted bytes — if you mutate one copy's state at runtime, the other copy never sees the change, because they're no longer the same object. That's a genuinely nasty class of bug to track down.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The same mechanism applies to plain AssetBundles too: if two bundles share an implicit dependency that isn't explicitly assigned to a bundle, Unity duplicates it into both.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to find duplicates: the Analyze tool
&lt;/h2&gt;

&lt;p&gt;Unity ships a built-in detector. Open:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Window → Asset Management → Addressables → Analyze&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Run the rule &lt;strong&gt;Check Duplicate Bundle Dependencies&lt;/strong&gt;. It scans every group with a &lt;code&gt;BundledAssetGroupSchema&lt;/code&gt;, projects the bundle layout, and reports any asset that would end up in more than one bundle. (The related &lt;strong&gt;Bundle Layout Preview&lt;/strong&gt; rule is useful context — it shows you the full projected layout.)&lt;/p&gt;

&lt;p&gt;&lt;code&gt;Check Duplicate Bundle Dependencies&lt;/code&gt; is a &lt;strong&gt;fixable&lt;/strong&gt; rule, meaning Unity can attempt an automatic resolution — but read the trap section below before you trust it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to fix it
&lt;/h2&gt;

&lt;p&gt;Three legitimate fixes, in rough order of control:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Make the shared asset Addressable yourself
&lt;/h3&gt;

&lt;p&gt;The cleanest fix. Mark the shared dependency (the material, in our example) as Addressable and assign it to a group. Now it lives in exactly one bundle, and every bundle that references it simply loads that bundle as a &lt;strong&gt;dependency&lt;/strong&gt;. One copy, on disk and in memory.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Run the automatic fix
&lt;/h3&gt;

&lt;p&gt;If the rule finds issues, you can run its &lt;strong&gt;Fix&lt;/strong&gt; operation. Unity creates a &lt;em&gt;new&lt;/em&gt; Addressable group and moves all the shared dependencies into it. Fast, but blunt.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Group prefabs that share dependencies together
&lt;/h3&gt;

&lt;p&gt;If two prefabs always load together anyway, just put them in the &lt;strong&gt;same&lt;/strong&gt; group. They'll share the dependency inside one bundle, no extraction needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  ⚠️ The false-positive trap (read this before you click Fix)
&lt;/h2&gt;

&lt;p&gt;The automatic fix is not always right, and two cases trip it up constantly:&lt;/p&gt;

&lt;h3&gt;
  
  
  Multi-object assets (e.g. an FBX with many meshes)
&lt;/h3&gt;

&lt;p&gt;If a single asset contains multiple objects, different groups can legitimately pull in &lt;strong&gt;different parts&lt;/strong&gt; of it without actually duplicating anything. The textbook case is an FBX with several meshes: mesh A in GroupA, mesh B in GroupB. The Analyze rule sees the &lt;strong&gt;shared FBX&lt;/strong&gt; and reports it as duplicated — but nothing is actually duplicated. If you run the automatic Fix, Unity yanks the whole FBX out into its own group, which can make your layout &lt;em&gt;worse&lt;/em&gt;, not better.&lt;/p&gt;

&lt;h3&gt;
  
  
  SpriteAtlases
&lt;/h3&gt;

&lt;p&gt;Addressables handles SpriteAtlases differently. If an atlas is marked Addressable in its own bundle, the atlas texture lives only there and other bundles reference it — no duplication. But if the atlas is &lt;strong&gt;not&lt;/strong&gt; Addressable (or doesn't have &lt;em&gt;Include in Build&lt;/em&gt; enabled), each sprite that ships can carry its own copy of the pixel data, and the same sprite in multiple bundles duplicates that data. The fix is the same principle as #1: mark the sprites/atlas Addressable and put them in a dedicated group.&lt;/p&gt;

&lt;h3&gt;
  
  
  The runtime cost of over-extracting
&lt;/h3&gt;

&lt;p&gt;Even when extraction &lt;em&gt;is&lt;/em&gt; correct, it isn't free. Once a dependency lives in its own bundle, that bundle becomes a &lt;strong&gt;load-time dependency&lt;/strong&gt;: it must be loaded whenever you load anything that references it — even if none of &lt;em&gt;its&lt;/em&gt; assets are used yet. Loading a bundle has its own runtime cost. For small, always-co-loaded dependencies, packing them &lt;strong&gt;together&lt;/strong&gt; is often better than splitting every one into its own bundle. Deduplication is a tradeoff, not a free win.&lt;/p&gt;

&lt;h2&gt;
  
  
  A separate case: Resources-folder duplication
&lt;/h2&gt;

&lt;p&gt;There's a related rule, &lt;strong&gt;Check Resources to Addressable Duplicate Dependencies&lt;/strong&gt;, that flags assets duplicated between your Addressables build and the &lt;code&gt;Resources/&lt;/code&gt; folder — meaning the data ships in &lt;em&gt;both&lt;/em&gt; the player build and the Addressables data. Unlike bundle duplication, this rule is &lt;strong&gt;informational only&lt;/strong&gt;: there's no safe automatic action. The usual manual fix is to move the asset out of &lt;code&gt;Resources/&lt;/code&gt; and make it Addressable instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Verifying the fix
&lt;/h2&gt;

&lt;p&gt;After fixing, re-run &lt;strong&gt;Check Duplicate Bundle Dependencies&lt;/strong&gt; — it should come back clean for the cases you intended to resolve. Then rebuild and check the &lt;strong&gt;Editor Log&lt;/strong&gt; (Console → top-right dropdown → &lt;em&gt;Open Editor Log&lt;/em&gt;) for the per-asset size breakdown, or use the &lt;strong&gt;Build Layout Report&lt;/strong&gt;, to confirm the duplicated bytes are actually gone.&lt;/p&gt;

&lt;h2&gt;
  
  
  The tool I ended up building
&lt;/h2&gt;

&lt;p&gt;Hunting duplicates by eye — and knowing which reports are real versus the multi-object false positives above — is exactly the kind of tedious, high-stakes work that's easy to get wrong. I got tired of doing it manually, so I built &lt;a href="https://perflint.dev" rel="noopener noreferrer"&gt;PerfLint for Unity&lt;/a&gt;: it scans your project locally (nothing is ever uploaded — zero telemetry) and flags assets duplicated across Addressable groups, showing each duplicate's memory cost and where it's referenced. It's deliberately conservative: it won't push you to auto-extract something that only &lt;em&gt;looks&lt;/em&gt; duplicated.&lt;/p&gt;

&lt;p&gt;The scan and the shareable health report are free. If you run it on your project, I'd genuinely love to hear what it found — or missed. That feedback is worth more to me than anything else at this stage.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Questions about your specific Addressables layout? Drop a comment — happy to look at Analyze output or Build Layout Reports.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>unity3d</category>
      <category>gamedev</category>
      <category>performance</category>
      <category>csharp</category>
    </item>
  </channel>
</rss>
