Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Prefab variants dramatic increase in size due to duplicate data getting serialized

Discussion in 'Prefabs' started by eugene_TT, Jun 25, 2020.

  1. eugene_TT

    eugene_TT

    Joined:
    Jan 22, 2019
    Posts:
    3
    Has anyone encountered the issue where their prefab variants slowly increase in size due to data being duplicated in the variant? A prefab variant that starts off as a couple of kb can slowly increase in size over time until it is in the mb range in size.

    When opening the prefab and inspecting the yaml there are hundreds of duplicate entries. The most common duplicate entry is the m_RootOrder property that gets serialized for any gameObject. (But sometimes other data gets duplicated as well).

    It is possible to manually remove the duplicate data (although it can be a bit tedious). But over time the duplicate data reappears.
     
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    @eugene_TT
    Which version of the Editor are you using?
    Are the duplicates identical in both fileid and guid?
     
  3. eugene_TT

    eugene_TT

    Joined:
    Jan 22, 2019
    Posts:
    3
    @SteenLund Currently I am using 2019.3.3f1, but I've seen the issue previously with 2018.4.11f1. Yes, the duplicates are identical in both field and guid. typical example from the prefab variant would be something like:

    - target: {fileID: 1216425444298024552, guid: 53bd3e0f187988a479e5881cb07d25c0,
    type: 3}
    propertyPath: m_RootOrder
    value: 12
    objectReference: {fileID: 0}
    - target: {fileID: 1216425444298024552, guid: 53bd3e0f187988a479e5881cb07d25c0,
    type: 3}
    propertyPath: m_RootOrder
    value: 12
    objectReference: {fileID: 0}

    Everything is identical and it can be hundreds of entries of the same prefab override.

    The prefab is checked into source control. The main reason we notice it is that the prefab variant can get extremely large in size. it happens slowly at first, so it is hard to notice.
     
  4. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    @eugene_TT

    Ok this is a known bug that has been fixed in 2019.4. Not only will it no longer produce these duplicates, they will also be removed when you resave the prefab
     
  5. eugene_TT

    eugene_TT

    Joined:
    Jan 22, 2019
    Posts:
    3
    @SteenLund Marvelous! That is great news! We are upgrading to 2019.4 soon.

    Thank you.