Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-9337

JMimeMagic may consume all memory

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5
    • Fix Version/s: QualifiedToSchedule
    • Component/s: Convert

      Description

      From Chris Darroch:

      When certain large files were uploaded in the Nuxeo UI, they cause a memory heap exhaustion error:

      Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: java.lang.OutOfMemoryError. message: Java heap space
      at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:39)
      at java.nio.ByteBuffer.allocate(ByteBuffer.java:312)
      at net.sf.jmimemagic.MagicMatcher.testInternal(MagicMatcher.java:393)
      at net.sf.jmimemagic.MagicMatcher.test(MagicMatcher.java:237)
      at net.sf.jmimemagic.Magic.getMagicMatch(Magic.java:344)
      at org.nuxeo.ecm.platform.mimetype.service.MimetypeRegistryService.getMimetypeFromFile(MimetypeRegistryService.java:193)
      

      The problem seems to occur with large files (~1 GB) whose file extensions are not registered, e.g., "bigfile.rar". The JMimeMagic library appears to have a loop which attempts to read the entire file into memory; with a large file, it exhausts all available heap space.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated: