OOM in MagicMimeMimeDetector
Brought to you by:
smcardle
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.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
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.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
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