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. Dismiss Notice

Unity Editor cache folder leak. (Ran out of space on disk)

Discussion in 'Editor & General Support' started by zezba9000, May 26, 2021.

  1. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    So was doing some Android builds & got an error that my hard-drive space was gone.
    The library cache folder took up over 100+ GB of space. And this is for a small custom SRP dev proj.

    Unity 2020.3.9
    Windows 10
     
  2. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    After cleaning the library folder and doing some more Android builds here are the file/folder sizes.
    Most notable are "Artifacts" & "ShaderCache".
    upload_2021-5-26_17-27-35.png
     
  3. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    So "ShaderCache" seems to be where its probably at.
    Its size increased over a 1.5 GB for a new build with little to no changes. Seems like if I have more shader changes this also increases each build even more as those would increase at least over 2gb each build if not more.
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
  5. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    Thats the first thing I did & considering I had Zero-GB free kinda had too :)
    I actually deleted all cache folders just to be sure.
    So sounds like a possible regression. If someone needs the SRP proj on the Unity team I'd be happy to oblige if it helps.
     
    Joe-Censored likes this.
  6. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,820
    ShaderCache is not only for the error DB, it also contains compiled shader variant cache. If you modify a shader, we don't delete the variants from the old shader source, as one may want to change it back.
    Does it grow if you don't do any changes to shaders or shader include files and do a build?
     
  7. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    Doing some clean test builds now. Will post results after.

    But regardless of this, the logical solution is to GC unused cache. This is problematic when testing SRP core shader changes. At least an option to enable GC would be nice as 120+ GB of data for a couple shaders is ridiculous when making test builds.
     
  8. zezba9000

    zezba9000

    Joined:
    Sep 28, 2010
    Posts:
    979
    So size doesn't increase if shaders don't change but as I said before there really should be a GC cleaning up stuff from at least 5 builds ago that weren't used in the current build.
     
  9. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,820
    Definitely :)
     
  10. Juho_Oravainen

    Juho_Oravainen

    Unity Technologies

    Joined:
    Jun 5, 2014
    Posts:
    41
    zezba9000 and Joe-Censored like this.
  11. Tensor2

    Tensor2

    Joined:
    Sep 13, 2015
    Posts:
    12

    My project has about 150gb of actual files (mostly just music). The library folder is 1.7 TB. A bigger SSD will run me $500. Unity's library folder garbage can go to hell. Ignoring it is not a valid option. Unity is simply not being reasonable. The ShaderCache for my project has passed 150 gb, more than the entire actual project itself.

    You need to seriously rework the entire library folder. Put a priority on this. It is not tenable. You are wasting my valuable development time and I cannot even open the project.
     
  12. aleksandrk

    aleksandrk

    Unity Technologies

    Joined:
    Jul 3, 2017
    Posts:
    2,820
    @Tensor2 which Unity version do you use? The issue with shader cache growing indefinitely has been fixed a while ago.