I am pretty sure that you need to set imageReaderCache = null before TileBuilderTask.compute() returns. As it is, the four tasks created around line 205 in TileBuilder.java will all hold references to their imageReaderCache instances simultaneously, effectively using 4 times the intended amount of memory.
All their descendant tasks will also reference those imageReaderCache instances too, and the ForkJoinPool will apparently continue to reference all the tasks, even after they are done computing. Which is why I suggest this be solved by setting imageReaderCache = null individually for each task just before TileBuilderTask.compute() returns.
I am pretty sure that you need to set
imageReaderCache = null
before TileBuilderTask.compute() returns. As it is, the four tasks created around line 205 in TileBuilder.java will all hold references to theirimageReaderCache
instances simultaneously, effectively using 4 times the intended amount of memory.All their descendant tasks will also reference those
imageReaderCache
instances too, and theForkJoinPool
will apparently continue to reference all the tasks, even after they are done computing. Which is why I suggest this be solved by settingimageReaderCache = null
individually for each task just beforeTileBuilderTask.compute()
returns.this only matters if maxImageCachePercentage > 0.