We are having bad problems with the VoxLogicA tool, which uses SimpleITK in a highly concurrent manner; the problems manifest themselves only on a recent machine with a 16-cores Intel Core i7 processor and 32GB of RAM.
The tool allocates plenty of images as the result of computing thousands of tasks concurrently; images are never de-allocated (which is indeed a missing feature). However, current usage of the tool in the case study we are working on, is about 6GB of resident size, therefore I would not expect that the tool has run out of ram. Anyway
Problem 1) sometimes we get incorrect results, and inspecting the intermediate images, we find images that clearly are an overlap of other computed images, as if the image buffer for some calculation has been reused. I do understand this may be related to “lazy” behaviour in SimpleITK (of which I have no knowledge except a remark by @blowekamp in another thread); and I do understand that I need to use “makeunique”; but don’t really know how. I’ve tried to add “makeunique” before every image creation and also before accessing internal image buffers; the latter is probably not necessary if done at creation time? However: the program has become slower, and problem 2 has become much more prominent.
Problem 2) we frequently get a “System.AccessviolationException: Attempted to read or write protected memory” in “Invoke” which — I believe — should be the invocation of external functions.
I still hope all of this is just due to insufficent memory and therefore to missing garbage collection in VoxLogicA but: shouldn’t I get some other form of exception in that case?