imglib / imglib2-cache

Cache interfaces and java.lang.ref based implementation.
Other
6 stars 4 forks source link

How to make sure a cached Cell is not GCed? #23

Open tpietzsch opened 6 months ago

tpietzsch commented 6 months ago

Recently, in the context of BigStitcher-Spark, I worked on prefetching Cells of a cached CellImg from S3. The idea is to touch a pixel (Type) from each Cell. We then want to hold on to those Types, so that the Cell is not GCed.

The question is whether that is actually sufficient to hold on to the Type. What do we actually need to hold a strong reference to? The Type, the Sampler, or the Cell?

This should be documented somewhere!