Jump to content

ObjectGrass memory leak in


Recommended Posts

Our art team has recently been having difficult with a memory leak using Editor 1 in Unigine (or, more accurately, the bespoke version that was supplied to us to deal with this terrain editing issue). The growth is in the order of 60 MB/s, and typically isn't noticed until performance becomes sluggish, with the editor crashing soon after.

We've had a lot of difficulty finding a reliable reproduction method, but investigation seems to point towards ObjectGrass nodes. The behaviour is something like this:

  1. Begin editing an ObjectGrass mask. It doesn't matter if the changes are large or small; all that matters is that the mask is modified somehow.
  2. Still within the Mask Editor, move the editor camera to a different location, keeping an eye on application memory usage.
  3. Continue trying different locations. Eventually the leak will occur. This can take anywhere up to a few minutes, and the offending position doesn't appear to be consistent.
  4. At this point, the leak can be stopped by:
    1. Modifying the mask again, or
    2. Moving the camera back to a "safe" spot.

What's worse is that the leak can occur after exiting the Mask Editor. In this case, the leak can be stopped by anything that invalidates the ObjectGrass node, such as toggling settings. Disabling the node will only halt the leak, and it will continue once the node is re-enabled. Explicitly calling ObjectGrass::invalidate() will also be effective in stopping the leak.

It might also be worth noting that we share masks between multiple ObjectGrass nodes, and that the leak is sometimes caused by one of these other nodes, not the ObjectGrass node that was originally edited.

Because we're never sure when or where the leak will begin, or even precisely which node is causing it, dealing with this has been difficult for the art team. For now, we're instructing them to save often, and keep an eye on memory usage, but this still results in work occasionally being lost. It would be neat to have a proper fix that avoids this trouble.

Thanks for any tips or help!

Link to comment

Hello, Simon! Thank you for feedback

Is there any chance I could ask you to share  parameters which is used for ObjectGrass to reproduce problem more accurately?
Would be great to see screenshot of "Node", "Surface", "Grass"  tab and also preset used for mask image like type and size.



Link to comment

I've attached a stripped down version of one of our worlds. After modifying the ObjectGrass mask, I was usually able to reproduce the issue within 30 seconds, usually just by moving the camera to the right, then back left again. In previous testing, on other worlds, it has taken minutes to find the right location to get the leak to commence.


Link to comment

We found a problem and while we are trying to figure out the exactly reason,  we can offer you the following workaround:

To avoid memory leaks while editing the mask, before starting open "Surface tab" of "ObjectGrass" and adjust "Max Visibility" parameter for value greater than the size of "ObjectGrass" node, for example - if the size of the "ObjectGrass" in your scene is 4000x4000, set the "Max Visibility" to 5000 unit

After finish editing, close the mask editor and return the original value for Max Visibility parameter

We hope this helps you deal with the problem before we find a solution. Thanks !

Link to comment
  • 2 weeks later...

Hello @craig.biggs

We are keep investigating, but mostly developers are aim on upcoming 2.10 release.

How critical is this problem for you now? If it's definitely a stopper, let us know and we change priorities to solve your problem as soon as possible.


Link to comment

We have a workaround but ideally this would be addressed in 2.10. Taking new releases of Unigine is a large time investment for us and we have high hopes for 2.10 since it solves our terrain editing issues.

Link to comment

Hello Craig,

Just to clarify some aspects of the upcoming 2.10:

  • ObjectTerrain will be completely removed and replaced with new terrain (and new terrain brushes). New terrain is based on a completely new design and should be rebuild from scratch in 2.10. I assume you still have some source textures, so it will be not that hard.
  • Grass memory leak already fixed in the 2.10
  • 2.9 and 2.10 has API changes that will require some manual code migration

If you really need this fix for 2.6 — we can back port changes and build a patch. This can take some time, because our build environment changed a lot since that time.

If you're ready for 2.10 and migration, there's nothing to do but wait for the stable release.

Thank you!


  • Like 1

How to submit a good bug report
FTP server for test scenes and user uploads:

Link to comment
  • Create New...