Swarm maxing out my PC memory

When rebuilding lighting, I’ve run into an issue where swarm will max out my memory in the task manager and (practically) lock up my PC. I have two options at this point:

  1. I can wait over an hour for the process to finish while my PC is unusable. The level takes 5-7min to rebuild lighting when this problem doesn’t exist.
  2. I can hard power cycle my PC (not good obviously)

I’ve found the problem, or at least I found a work around… which is some problematic tree meshes from the “Open World Demo Collection” project. I can re-build maps using these mesh if it’s a small map. But adding these meshes to larger maps will cause the problem above to occur.

I posting this so to help others that may come across this issue. But let me know if you want more information from me.

Hi Niles,

The Open World content is very performance heavy without using LODs or lower lightmap resolutions. That content is actually meant to be used with Dynamic Lighting, although it does have a lightmap and a resolution set. If I recall the LM resolution was set to something like 4096 which is extremely high. If you’ve got a few or more of these in your level the light calculation and light build will take longer and use more processing. I would recommend only using this content with dynamic lighting and turning off static shadowing for these.

Alternatively, if you wanted to use them for static lighting try using a much lower lightmap resolution.

Also, since light builds are done solely on the CPU and do not use the GPU at all the biggest factor here is going to be CPU cores you have available for the light build and the amount of RAM you have. The more the better and faster your builds will be. It will still take a while depending on the scene, number of lights, number of meshes and their complexity, etc.

I hope this helps.


Hey Tim, thanks for the reply. Very useful info.

  • I fixed the problem by dropping the lightmap resolution on those static meshes to a reasonable number (2048 → 4).
  • I still find it concerning/odd that Swarm would be able to essentially freeze up my memory. I can understand waiting a long time for a lightmap job to execute… but having to hard cycle my PC to cancel the process is pretty bad. Maybe this is more an issue with Windows?

Swarm is very a very CPU intensive process. If you have a complex scene it’ll use more calculations and RAM.

So more than likely, depending on the scene and the amount of RAM you have this is why your computer may feel sluggish or unresponsive. As for CPU cores being used, if you’ve got a Dual Core processor Swarm Agent will leave a single core free for other tasks or operations, whereas if you have 4 or more cores Swarm Agent will leave 2 cores free for tasks or operations. This is still predicated that you have enough RAM free to perform normal operations though.