Custom Preview memory grows continuously when orienting a mesh

I am seeing continuous memory growth in Rhino 8 for Mac when repeatedly changing the geometry passed through Grasshopper’s native Custom Preview component.

>>1.00<<

Minimal setup shown below:

  • A list of internalized meshes is oriented from the World XY plane to a rotated XY plane.
  • Rotation angle is changed repeatedly with a slider.
  • Oriented mesh is connected to a Custom Preview component with a colour swatch.
  • Rhino viewport in Shaded mode.

With repeated slider changes, Rhino’s memory use keeps increasing and does not appear to level off, even though the definition only displays one set of transformed meshes at a time.

Is this expected preview-cache (?) behavior, or could it be a Rhino 8 for Mac / Custom Preview memory issue? Is there a recommended way to repeatedly preview changing geometry without retaining memory for every previous state?
Could somoene check if the same thing happens in Rhino for Windows?
Why is the memory not freed / garbage collected in some way?

Memory_Increase_minimal01.gh (3.3 MB)

i think it cashes the results so they do not recompute each time and discards them later or after some threshold is reached

It looks to be the canvas repaint vs the custom preview. Here’s a youtrack to look into it.

RH-99543 Grasshopper canvas repaint leaks memory on Mac

It does not seem to discard them. The occupied memory never goes down again.

Is there any plan on fixing this?
This is a really common issue for everyone working on any kind of kinematic system such as robotics or machine simulation. It also seems to point to a deeper issue with the way garbage collection is done on gh for mac, which probably has other negetive consequences elsewhere.

I dont think its a canvas redrawing issue. The memory increase is substantial, not just a few kb for canvas displays.
Memory does not increase (or at least not noticeably) if there is no preview in Rhino.

>>1.00<<>>1.00<<>>1.00<<