Search Unity

Library folder goes way too big!

Discussion in 'Editor & General Support' started by giorgos_gs, Mar 29, 2019.

  1. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Hi there,
    Unity is great, I switched all my project to it.
    Most of us use SSDs to work faster and one of the main probems is SSDs filling up really fast.
    Unity Library folder is to blame.
    In most of my projects library folder takes up 90% of the space.
    All my assets folder is 733MB in this example and Unity library is 5.8GB.
    Can you guys work towards reducing this?
    I see that you made package manager to reduce the space from the assets but this is way smaller than the library folder.

     
  2. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,155
    I'd be surprised if there were a practical way to reduce it without negatively affecting the time it takes to perform tasks in the editor. If I were you I would just buy a USB 3.0 flash drive, move the Library folder to it, and create a symlink for it.
    Code (csharp):
    1. mklink /d "Library" "usb drive path"
    Alternatively you could try deleting it to see if it ends up smaller when it is regenerated.
     
    Deleted User likes this.
  3. Deleted User

    Deleted User

    Guest

    Could you explain that part? I'm interested in moving the library folders for each of my projects into one and unique place on another drive.

    Thank you. :)

    Note: I'm asking here instead of searching the web so that everyone can take advantage of your answer. ;)
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,155
    You basically move the folder to the location you want it to reside, and from a command prompt in the original location for the folder you type the following command:
    Code (csharp):
    1. mklink /d "folder name" "path to new location"
    Symbolic links are available starting with Windows Vista. Older releases of Windows (namely 2000 and XP) use a different command that functions mostly the same but with a little less flexibility and less security due to using a different approach.
    Code (csharp):
    1. junction "folder name" "path to new location"
    Reference material

    https://stackoverflow.com/questions...n-points-and-symbolic-links/48586946#48586946
     
    Last edited: Mar 29, 2019
  5. Deleted User

    Deleted User

    Guest

    Well, I did it and it worked, until I had to upgrade the project to a new version. Copying a dll in the remote library folder didn't work and the editor threw an error. I had to place the library folder where it originally was.
     
  6. JeffDUnity3D

    JeffDUnity3D

    Joined:
    May 2, 2017
    Posts:
    14,446
    I would not recommend moving the Library folder. The best you can do really is to delete it, then allow Unity to recreate the next time you run the app.
     
  7. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    It is not 2015 anymore. 1TB Samsung QVO SSD's are barely over $100 right now. EVO about $150. A 6GB library folder shouldn't be much issue today on SSD.
     
    Michael_Berna and Ryiah like this.
  8. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,155
    Odd. I'll have to check it out later when I have the chance.

    We may have moved forward to bigger and better things on the PC, but Apple continues to stagnate. A quick check shows that the biggest SSD you can get for the $1099 iMac is only 256 GB and that's paying an additional $200. If you need more than that you have to jump to the $1299 iMac and pay an additional $800 for a mere 1 TB.

    Meanwhile we can pick up a 4 TB Samsung 860 EVO SSD for only $700. Or a 4TB Samsung 860 QVO for $550.

    https://www.amazon.com/Samsung-Inch-Internal-MZ-76E4T0B-AM/dp/B07864XY8B - EVO
    https://www.amazon.com/dp/B07L3CLM2B/ - QVO
     
    Last edited: Mar 29, 2019
    Joe-Censored likes this.
  9. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    Geez, I haven't looked at computers from paying for the logo companies like Apple in a while. Didn't realize they got that bad. I still don't think Unity should make any changes to work around Apple insulting the intelligence and wallets of their customers though.
     
    Michael_Berna and Ryiah like this.
  10. Deleted User

    Deleted User

    Guest

    Can't you plug any external SSD to a Mac?
     
    Ryiah and Joe-Censored like this.
  11. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,155
    Yes, and I was just about to mention that there is a USB 3.0 enclosure available for only $9 on Amazon. I have one of these with a Samsung 860 EVO 1TB drive in it and it definitely achieves the performance you would expect of USB 3.0 and it's completely powered by the port too making it very easy to carry around.

    https://www.amazon.com/Sabrent-Tool-free-Enclosure-Optimized-EC-UASP/dp/B00OJ3UJ2S/
     
    Last edited: Mar 29, 2019
  12. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    In order to build and test for Mac and iOS I need a Mac and that is why I use a dualboot (Plus Windows 10) Mac Pro. If I didnt need those 2 I would buy my dream pc.
     
  13. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    It takes too long in big projects and it may come up smaller but after a while it gets bigger again.
     
    assertor likes this.
  14. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    Its still a problem if you have many projects and also many variants of them (Eg one of PS4 one for Switch etc)
     
  15. Deleted User

    Deleted User

    Guest

    I'm afraid if you are a pro, you need pro material. Using a large external SSD should help. Install Unity and all your projects on that new drive. ;)
     
  16. giorgos_gs

    giorgos_gs

    Joined:
    Apr 23, 2014
    Posts:
    623
    I am waiting for the new Mac Pro to be announced in this summer! :)
     
  17. DouglasWilliams

    DouglasWilliams

    Joined:
    May 9, 2019
    Posts:
    1
    Another working option would be to use longpathtool utility. Had the same issue and pretty much solved it.
     
  18. ArachnidAnimal

    ArachnidAnimal

    Joined:
    Mar 3, 2015
    Posts:
    1,821
    Why doesn't Unity get the Occlusion folder out of the Library?

    IMO It doesn't belong in the Library folder. It should be treated as a seperate cache just like the GICache. That is 300,000 files right there that could be eliminated from the Library. Right
     
    giorgos_gs likes this.
  19. suleymanbucuk

    suleymanbucuk

    Joined:
    Mar 13, 2019
    Posts:
    11
    My Library folder was 9.57GB and 6.5GB of this was Artifacts folder. Deleted the Artifacts folder and Unity works fine with no error and builds without error. 6.5GB is not a lot but there were 79.000 + files in Artifact folder and when i copy whole project to another drive for backup, it took 10 to 12 minutes to copy. Now it takes only 3-4 minutes.
     
    Behappy859 likes this.
  20. nick-morhun

    nick-morhun

    Joined:
    May 12, 2015
    Posts:
    51
    Hi! You don't need to back up the Library folder since 99% of its content can be regenerated by Unity. And the remaining 1% are some of your local setup options (and maybe they moved them away in the new versions).
     
  21. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,700
    I'm not sure why you're copying the project... You may want to consider using source control in order to guard and protect your hard-earned work.

    With source control you do NOT source control the Library folder.

    Personally I use git because it is free and there are tons of tutorials out there to help you set it up.

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837

    Setting up the right .gitignore file:

    https://forum.unity.com/threads/removing-il2cpp_cache-from-project.1084607/#post-6997067
     
    ThynkTekStudio likes this.