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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Scene size exceeded 9.3Gb

Discussion in 'Editor & General Support' started by Lacostic, Jul 8, 2019.

  1. Lacostic

    Lacostic

    Joined:
    Nov 29, 2017
    Posts:
    14
    Hi,
    I know it’s sounds silly, but still...
    I saved my Unity scene and can’t open it anymore (
    The error message is ‘serialized file size of 9.36 GB exceeds maximum’
    I know the cause, it’s because EasyRoads plug-in produces new game objects for roads side objects instead of using prefabs. But it doesn’t do situation easer (

    Did somebody got the same problem, is there solution to open such a large scene file?

    Thank you
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,851
    Serialized files have a 4gb limit due to internal engine limitations. If you have a scene at 9.36GB then you will not be able to open it. You could try to hack it down in a text editor, it would be a bit of a nightmare to do. Its likely that the work in this scene is lost.
    I suggest you look at converting the objects into prefabs after they have been generated or build them into asset bundles. You could also try using multiple scenes to spread the load.

    We are working on improving things so that in the future we should be able to support files over 4gb however this is not currently available and is not guranteed to happen at the moment(its experimental). If you have a spare moment we would appreciate it if you could file a bug report and include the large scene file so we can test our changes against it, to see if it addresses your problems, although I suspect it will not work with files generated before our changes. You wont be able to upload it through the bug reporter tool though, we will send you details on how to upload large files when you submit the bug.

    Its also worth considering the hardware your game will run on, will they have 10gb RAM free for your game scene to load? 8GB is the most popular https://store.steampowered.com/hwsurvey/Steam-Hardware-Software-Survey-Welcome-to-Steam
     
    Peter77 likes this.
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    Seems like the editor really, really should alert you when SAVING a scene >4GB that opening that scene in the future won't be supported.
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,851
    We do have errors/warnings for this. Its possible it did not print the error or it was ignored. Please file a bug report so we can investigate if an error was not produced.
     
  5. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    It shouldn't even save it...
     
    deac0n, KarlKarl2000 and Peter77 like this.
  6. Lacostic

    Lacostic

    Joined:
    Nov 29, 2017
    Posts:
    14
    Thank you for reply.
    Seems like it would be easier to recreate scene from back up ( At least I have all assets saved.
    Usually I'm always watching to replace all generated objects by prefabs, this time it was happened by mistake.

    But I'm agreed with @StarManta and @APSchmidt, editor shouldn't even save the scene, or at least to give a warning. Like a Photoshop do. I had no warning, the editor just saved scene happily and can't open it anymore. Quite a philosophic dilemma – the being can either create a stone it cannot lift, or it cannot create a stone it cannot lift. ...

    Regarding RAM and hardware – I'm using custom MacPro 5.1 with NVIDIA GTX 1080Ti and 96GB of RAM on board. Pretty happy with this configuration.
     
  7. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,851
    Could you please file a bug report so we can investigate this?

    But what about the people who will be playing your game, will they have 96GB of ram ;)
     
    skoteskote and xVergilx like this.
  8. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    If they really love my game they'll upgrade :p
     
    karl_jones likes this.
  9. Lacostic

    Lacostic

    Joined:
    Nov 29, 2017
    Posts:
    14
    Just wrote a bug report.
    Regarding this "But what about the people who will be playing your game, will they have 96GB of ram ;)"
    Please don't blame me, actually I hanen't planned to publish the game at all :)
    In this case I used Unity to create cinematic video. Unfortunately I need a birds eye view for this scene, that's why it became quite a large. But 10.3GB is way too mach even for this case, using prefabs cuts the size 10 times. Just forgot to replace game objects by prefabs before save the scene :-(
     
    karl_jones likes this.
  10. APSchmidtOfOld

    APSchmidtOfOld

    Joined:
    Aug 8, 2016
    Posts:
    4,473
    That's exactly how triple a game studios reason, "Let's make our games bigger and bigger, those who love us buy new computers!" This is disgusting. ;)

    Now we can go back on topic. :p
     
    Joe-Censored and karl_jones like this.
  11. BradZoob

    BradZoob

    Joined:
    Feb 12, 2014
    Posts:
    66
    *jaw drops* Undocumented limitations of the engine may cause a destructive non recoverable scene crash without warnings nor remediation. Um. You could just _not_ write to the scene file if a serialized data node exceeds a certain size? Seriously, you best hope a bunch of thirsty lawyers aren't making an indie game with Unity and stumble into this little gem, "fine print" don't work in cases like this buddy :p
     
  12. GarrettCMiller

    GarrettCMiller

    Joined:
    Jan 20, 2013
    Posts:
    30
    I see what you guys mean about it being a nightmare to try and go through a scene file with a text editor. I have the same problem, I made changes to a file, saved it not knowing it was over 4 GB (4.8) and then cannot open it. Unfortunately, my latest backup was made right after I saved it, so I didn't realize my only backup in 2 weeks was also, essentially, corrupted/unusable, at the moment at least. Does Unity have a method yet to repair this? It's only one root level object in the scene causing the memory problem (Voxeland), the rest of the scene minus the Voxeland object is roughly 25 MB.

    I've tried looking at old Voxeland-only scenes I've saved (when I was keeping scenes separated), in a text editor (Beyond Compare is only so useful, but still useful) and it's hard to determine what the root (and only) object in the scene is and what its specific data might be like so I can try removing the "offending" data from my current scene and NOT lose 2 weeks of work. A sure sign I need to switch to a real back-up system now that isn't "copy entire project folder to an external drive every once in a while." :rolleyes:o_O
     
  13. NuclearC00kie

    NuclearC00kie

    Joined:
    Apr 11, 2019
    Posts:
    32
    I don't know if this will work. I haven't tried this myself. But can you try to change the asset serialization mode from text to binary?
    https://docs.unity3d.com/Manual/class-EditorManager.html

    Binary files are a lot smaller than text files. If unity manages to convert the big scene into a smaller binary scene, you might be able to open it, remove the content that makes it so big, and reconvert it to text format.

    The big question here is: Can unity convert a text scene that is +4Gb...
     
  14. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,449
  15. GarrettCMiller

    GarrettCMiller

    Joined:
    Jan 20, 2013
    Posts:
    30
    Thanks NuclearC00kie and Peter77! I will try the binary serialization approach first, and if that doesn't work, it's "backup and try Unity 2020.1" time!

    I agree with above posters that Unity should NOT even attempt to save a file over its own loading limit *hint hint Unity devs* :D But in all actuality, I really appreciate all the hard work that Unity's folks put into making this amazing tool, problems, bugs and errors or not! Keep up the amazing work guys! I've watched Unity change a lot since 2012!!!
     
  16. GarrettCMiller

    GarrettCMiller

    Joined:
    Jan 20, 2013
    Posts:
    30
    OMG *face palm* You'd think a 23 year programmer would be smarter... I set Unity's asset serialization mode to Binary and tried to reload the project. Somehow the scene file went from 4.8 GB to 9 KB and still won't load..... AND I didn't make a backup before I even did that!!! WHY?!?! *dramatic scene with rain pouring down on face as I look into the sky*

    Just note to all others that read this and haven't learned: For God's sake, make a backup annoyingly often. You might just thank yourself one day... :eek::eek:o_O:rolleyes::oops::mad::(

    Also, shameless plug, this is the project I was/am working on: The Skinwalker Investigations.

     
    Last edited: Apr 11, 2020
    Peter77 likes this.
  17. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    Yup, learn to use source control religiously. It will save your (coding) life.
     
    Kurt-Dekker and Joe-Censored like this.
  18. KarlKarl2000

    KarlKarl2000

    Joined:
    Jan 25, 2016
    Posts:
    592
    Bug Report: Case 1332852

    @karl_jones
    I just noticed Unity was crashing a LOT and thought it was something to do with the editor. But then I noticed other scenes could load.

    So I went to look at the one scene that kept crashing the editor. And I noticed by accident the file size is HUGE:eek:

    1.jpg

    You can see the BaseSceneB file is the backup file, from 2020. It's MUCH smaller. This scene is just 1 character and 1 platform.

    What causes Unity to increase a scenes file size?

    I did some tests deleting game objects and a red error caused the scene file to drop to 55KB. Its in the attached JPG
     

    Attached Files:

    • 44.jpg
      44.jpg
      File size:
      375.5 KB
      Views:
      283
    Last edited: Apr 30, 2021
  19. TorbenDK

    TorbenDK

    Joined:
    Jun 28, 2016
    Posts:
    24
    I had a scene file that exceeded 4GB and managed to fix it.

    At first I thought I could simply scan through the scenefile and remove a few huge elements, but no. When the scene was imported with these missing, the hierarchy was all messed up.

    But removing data from inside an object worked!

    What I did was first scan the file, using a filestream, and finding "--- !u!" which indicates the start of an object in the scene, like gameobject, meshfilter etc..
    Then I parsed to the next, and the next.. To get a list of all objects, their position in the scenefile and their sizes.

    Then I chose the biggest meshes and found the mesh's indices in "m_IndexBuffer" (I think), and simply edited all the values out.

    Everything is now showing as it was in the hierarchy in the scene, (even those big meshes, possibly because they were points), but Unity is complaining: "DrawBuffers() got a range of indices but no index buffer".

    I added my script here, rip it a part as much as you need.. Its not, you know.. nice.
    I did not include my debug class, so that at least needs to be edited. :)
     

    Attached Files:

    Last edited: May 18, 2021