Solution for graphs in SNAP

Hi Quentin, thanks for the input. This is very welcome.
You are right. SNAP uses too much memory. Actually, the memory management should work as you say, but it doesn’t.
The main reason is that both cases, processing from the Desktop and from the command line are handled the same. In the desktop you don’t know which data will be necessary next and if you can throw it away. It is not deterministic. Because the processing order is defined by the user by panning in the image view.
Actually, data in memory should be replaced by new data when the limit is reached. This is similar to your approach. When once computed and not used anymore the data drops out of the cache. But this doesn’t work as expected. often the cache reaches its limit already, throws way data and then it needs to be recomputed. And this happens several times.
In SNAP 8 we added the so-called Tile Cache Operator.
Please see the Release notes. Release notes](SNAP 8.0 released)
More details about it’s usage is in the wiki: How to Use Tile Cache Operator to Improve Memory Consumption - SNAP - SNAP Wiki (atlassian.net)

For sure this is currently too complicated for an average user but we plan to integrate this into the graph execution. But we like to gain some more experience with it.