Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Unity lights baking clogs my C:/ hard drive

Discussion in 'Editor & General Support' started by FullWolfmoon, Mar 29, 2021.

  1. FullWolfmoon

    FullWolfmoon

    Joined:
    Oct 6, 2020
    Posts:
    4
    I just realized that baking lights on Unity begins devouring GBs of my C:/ HDD despite Unity or the project not being there. After clearing the lights, the devoured GBs do not return, and I don't seem to be able to find where it is located. Thank you.
     
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,893
    I like to use this free tool to diagnose and clear up used hard disk space on my computer: https://www.fosshub.com/WinDirStat.html

    It should help you to find where your disk space is being eaten up.
     
  3. FullWolfmoon

    FullWolfmoon

    Joined:
    Oct 6, 2020
    Posts:
    4
    Thanks so much, it has definitely helped me a lot to empty the space. But still, the issue of Unity blackholing my GBs away when I bake the lights remains.
     
  4. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Did you clear the GI cache?

    https://docs.unity3d.com/Manual/Preferences.html#GI-Cache

    Basically, Unity caches a bunch of stuff forever, unless/unless you clear it. There's just a button for that in preferences. You can also tell it to cache somewhere else (like a second HDD), or set a max cache size if you're worried about running out of space again in the future.
     
    Joe-Censored likes this.
  5. Fovane

    Fovane

    Joined:
    Feb 6, 2023
    Posts:
    5
    I have similar problem. I don't know what's happening, but I can say that my Drive C is filling up when I start the game on editor. Also, When I stop the game from the editor, the filled space doesn't come back. The interesting thing is my unity, and the project are installed on my Drive D, and all cache folders (Global Cache and GI Cache etc.) relocated to Drive D already. Please help.
     
  6. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    I'd figure out where the space is going. Try a tool like WizTree or WinDirStat to see what's using up the drive space.
     
  7. Fovane

    Fovane

    Joined:
    Feb 6, 2023
    Posts:
    5
    I have found out the which file's size is increasing. The file name is Editor.log where located in C:\Users\"YOURUSER"\AppData\Local\Unity\Editor. That file's size is increasing when I start the game from editor, and keep its file size when I stop the game from editor.
     
  8. Fovane

    Fovane

    Joined:
    Feb 6, 2023
    Posts:
    5
    Oh OK. I understood. I have so many prefabs that each of them is creating a log to the console from a script by using Debug.Log() command. And I saw almost 300000 logs in the console for just a few minutes of game time. All of these logs are writing to the Editor.log file, so this makes the file bigger. Solution is deleting all unnecessary Debug.Log() commands from your script.
     
  9. dgoyette

    dgoyette

    Joined:
    Jul 1, 2016
    Posts:
    4,193
    Getting rig of unnecessary Debug.Log is also good for performance. Writing a lot of Debug.Log will definitely slow down the game quite a bit.