Search Issue Tracker

By Design

Votes

1

Found in

2021.3.40f1

2022.3.38f1

6000.0.10f1

Issue ID

UUM-75805

Regression

No

Baking large scene uses all available RAM and starts paging, then fills up disk

--

-

Repro project: [https://drive.google.com/drive/folders/1HumNeoSQ_dSMWpo7Lt12l5QMEiY_hjdV]

Reproduction steps:
1. Open the attached project "ReproProj"
2. Open the “Assets/Scenes/City.unity” Scene
3. Open the Lighting window (Window > Rendering > Lighting)
4. Click Generate Lighting
5. Open the Windows Task Manager
6. Observe the memory usage until it’s about 100%
7. Observe the free storage of the drive where the project is located

Expected result: Drive storage is not affected
Actual result: Unused drive storage starts to shrink

Reproducible with: 2021.3.40f1, 2022.3.38f1, 6000.0.10f1

Reproducible on:
Windows 10 Enterprise 21H2

Not reproducible on:
No other environment tested

  1. Resolution Note:

    The baking process will generate data that is stored to disk during the baking process.

    Initially the data for the bake will be collected this consists of geometries, materials, textures, settings etc. This is stored to disk. In this project it accounts for ~26GB. This is somewhat expanded when loaded when doing the actual bake - geometries are injected into bounding volume hierarchies etc. that is needed to build the global illumination. If this does not fit in RAM then it might page to disk.

    The configuration in the supplied project bakes ~100 4192x4192 lightmaps. Such a lightmap takes up ~200 MB of temporary storage per lightmap, once it is post-processed into a final lightmap it takes up ~95 MB on disk. This is ~31GB of data. When the bake is completed each lightmap is imported with normal quality resulting in ~40 MB per lightmap data.

    The takeaway is however that this project will use ~60 GB disk space.

    A way forward would be to break up the city into sectors that are baked individually. When baking a sector a script would load the sector itself, and neighbouring sectors additively as they will be needed to contribute to the bake. These neighbouring sectors should be set to contribute to GI but not to be lit by lightmaps. This way only data for the sector itself will be generated. This will result in less data churn and less temporary disk space used. It will also make it more likely to work with GPU Lightmapper.

    Let me know it this agrees with what you are experiencing. If not please reopen this with whatever extra information you might have.

Comments (1)

  1. caden3ds

    Jul 27, 2024 19:44

    Can you guys consider fixing this for unity 6 too?

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.