I have a folder with a single 7GB file that causes the indexer plugin to crash. The 7GB file is not a DICOM file so presumably it should not crash. Note that the size is about the size of my RAM allocated.
Latest indexer cloned with "hg clone <indexer mercurial link>". Orthanc 12.2
I experimentally determined that the exact way of crashing is that if the file size is greater than RAM size PLUS the swap size then on Ubuntu the exact error message is just "Killed". Which means that somewhere there is "malloc(entire_file_size)" which then crashes
The culprit https://orthanc.uclouvain.be/hg/orthanc-indexer/file/4bde2c2dc03c/Sources/Plugin.cpp#l102 I think it'd be nice to have it in the TODO to use mmap or something else to do this check without loading the whole file
I self-assign this
For reference, this issue is related to the following discussion on Discourse: https://discourse.orthanc-server.org/t/patch-for-orthanc-indexer-plugin-crashing-on-big-non-dicom-files/3849/7