Version 3.1.10 was released and includes a new setting to lower memory usage at the expense of MIME type detection. The mode in which we use the MIME type library, the entire file needs to be loaded into memory in order to the properly introspected.
We added the setting MIMETYPE_FILE_READ_SIZE to limit the number of bytes that are read. The default value of 0 causes Mayan to read the entire file in other to keep the current behavior. Set MIMETYPE_FILE_READ_SIZE to a number other than 0 to reduce the amount of the file that is read into memory. A number of 1024 is a good compromise as most magic numbers used to identify files are in the first bytes of the file. So far only the detection of .docx gets affected using a number other than 0 since .docx files are actually a compressed set of XML files and the magic numbers of compressed files are not necessarily at the start of the file.
https://docs.mayan-edms.com/releases/3. ... mory-usage
We are tying to come up with a long term solution for 100% of the cases without sacrificing detection. Out best idea is using something like a custom file object class that with buffered emitter to allow loading the entire file one block at a time. This is an ongoing research.
When things doesn't work as they should.