Slow editor and huge RAM usage

Hello everyone,

I am developing a 3D FPS in HDRP with Unity 2020.3.14f1 (LTS). I begun to build the first level and imported quite a few assets.

My problem is, that Unity has become utterly slow, to the point where it’s nearly not usable and I don’t think that my scene is the problem. Every time I create a game object or a prefab or material or basically anything the “Hold On” window shows up for at least 30s. Additionally Unity needs a lot of time to start. To me it seems like it is trying to load my whole project folder in RAM. My project folder as a whole is 55GB in size, my “Assets” folder is 20GB in size. But why would that be a problem? Most of the assets don’t get used yet, so why would it be a problem to have a lot of them?

When do performance problem occur:

  • when I start Unity it can take up to 10 minutes to start
  • when I enter playmode it takes up to 3 minutes to start
  • when I exit playmode it can take up to 10 minutes to exit and I am seeing a huge RAM usage spike up to 50 GB of “assured” memory (I don’t know what is called in the english resource manager, in german it means “zugesichert”). I don’t get why it would use this huge amount of ram.

My scene is not that huge, like I said I just begun building it (~50MB). And creating materials and so on is slow regardless of which scene is loaded. So my guessing is, that the RAM usage is the core problem (I only have 16GB of RAM so it gets dumped on the swap memory which is on an nVme SSD, but still lot slower than RAM). Even if the scene is not loaded, Unity has 20GB of “assured” memory and 28GB if I open my scene.

Unity even crashed multiple times, when I imported additional packages or assets. It crashed once when was exiting playmode (my guess is because it used way too much memory).

So how do I fix this problem? And if using a lot of assets is the problem, how would studios make big games in unity like at all?

My PC:

  • CPU: Ryzen 5 3600
  • GPU: RTX 2070 Super
  • RAM: 16GB
  • My project is on a SATA SSD

Thanks for your help in advance.

I would like to up that
I am having memory issues too on my MBP 2021
Unity used up to 30 GB of RAM and just grew bigger and bigger and just never stopped
Using Unity LTS 2020.3.26f1