Menu

#32 OOM in MagicMimeMimeDetector

open
Code (14)
9
2011-04-01
2011-01-07
No

MagicMimeMimeDetector should override delete() and clear its static MimeType list.
Everytime a new instance is created (use some scheduled task which does that), the same Entries are added to the list - which grows until a OOM does happen.
Use a Map here or call clear on the list to fix the OOM.

Discussion

  • Torsten Krah

    Torsten Krah - 2011-01-07
    • labels: --> Code
    • priority: 5 --> 9
     
  • Torsten Krah

    Torsten Krah - 2011-04-01
    • assigned_to: nobody --> smcardle
     
  • Anonymous

    Anonymous - 2011-10-05

    A simple solution may the following change:

    line 273:
    synchronized( MagicMimeMimeDetector.class ) {
    if( !mMagicMimeEntries.isEmpty() ) return;
    ...method body...
    }

    This speeds up the initialization (only done once) and makes it more thread safe.

     
  • Anonymous

    Anonymous - 2011-12-06

    I was also affected by this issue. I solved it by using a static initializer:

    static {
    MagicMimeMimeDetector.initMagicRules();
    }

    public MagicMimeMimeDetector() {
    }

    I think this bug is quite critical and a new bugfix release should be done.

    Thanks

     

Log in to post a comment.