Clearing Rhino Compute memory cache without restarting the local server

Dear all,

I am currently developing a tool to iterate geometries for optimisation purpose using rhino.compute locally. My process involves one request to rhino.compute per iteration and I run a few hundred iterations each time.

What I found is that the time taken for each request increases over time. Generating 100 iterations takes less than 10 minutes, where as generating 500 takes about 2.5 hours.

Tracking my machine’s memory usage, I can also see that my available memory is gradually decreasing during the process, and the time taken per iteration greatly increases once my machine is utilizing >95% of available memory.

I am wondering if there is a method to clear the memory stored without the need to restart the local server? Is there a setting to disable caching? Any help is much appreciated!

1 Like

I believe I have encountered a similar problem. In my opinion–if compute should be considered stateless–caching should not be enabled by default. In the future it would be great to see caching options with command line arguments and/or env-variables.

As a fix you could try to uncommenting and updating this line in the source:

with options from CacheItemPolicy Class (System.Runtime.Caching) | Microsoft Learn.
There are probably ways to disable caching completely as well.