Skip Loading GrassData on Server

We have a fairly large and dense landscape, so grass data is taking up quite a bit of memory. Does GrassData need to be loaded on the server? What’s the easiest way to skip loading it on the server?


Edit: On a semi-related note, it looks like “obj list” might be counting the GrassData towards both “NumKBytes” and “ExclusiveResKBytes”. ULandscapeComponent::GetResourceSize() includes a call to GrassData->GetAllocatedSize(), but GrassData is also serialized as part of ULandscapeComponent::Serialize(). Am I misunderstanding, or does this mean it’s being counted toward both columns?

I’ve confirmed that the grass data is being counted toward both “NumKBytes” and “ExclusiveResKBytes”. I deleted the grass data from our map and, on the server, the reported memory used by UObjects dropped roughly twice as much as the reported total process memory.

In ULandscapeComponent::Serialize(), I added a check for IsRunningDedicatedServer() and deleted the GrassData memory. Looking into a way to skip serializing it altogether.

Looks like short of embedding the size of GrassData into the saved file so I can make the FArchive Seek() past it, there’s no good way to skip loading the it on the server. Loading it and then unreferencing it so it can be deleted looks like my best bet.

Should free up about 700MB on our server!

Pretty slick Phillip!