5.2.0f1 out of memory when atlasing lightmaps

We upgraded to 5.2.0f1 to try some of the new VR optimizations, but we’ve been unable to bake lightmaps without our dev machines running out of memory. Unity goes from about 4 GB of memory used to 14 GB over the span of a few seconds when it begins the “atlasing” stage of baking.

The project we’re trying this with bakes in 4.6.7 without any trouble, and takes a long time in 5.1f3 with the same settings we’re using in 5.2 but finishes OK. Scene is about 100M wide and 500M long, but it runs at framerate on Gear VR and shouldn’t be very complex from a rendering standpoint. It’s the first time we’ve ever had memory issues with the editor.

Uninstalling all Unity versions / reinstalling did not seem to help. I can’t attach a sample project easily to submit a bug, so I’m wondering if anyone else has encountered this issue or if there are steps I can take to clear caches or other bad data that may be causing it?

Try clearing the cache…

Preferences → GI Cache → Clean Cache

Thanks for the suggestion, but clearing cache and even moving the cache to a different folder didn’t seem to help.

We introduced a bug into 5.2.0 that is causing this. It happens when you have a mesh with no UVs or UVs collapsed to a single point. Enabling “Generate lightmap UVs” for the offending mesh (on the mesh importer) works around the issue in the cases I’ve seen so far. I have a fix and it will go into 5.2.0 or 5.2.0p1. Trying to convince the release managers to let me put it into 5.2.0 :wink:

2 Likes

In case the arrival of RC2 stirs up the question: Fix is not in RC2.
We’re trying to see if we can land this in final, but that’s still being determined with QA team.

Got it. Thanks for the clarification. We’ll give the workaround a try.