jhy/jsoup — Issue #159: Possible Memory leak with ParseError
Author: erraggy
Created: 2011-12-14 22:44:30+00:00
State: open

After upgrading our dependency from 1.5.2 --> 1.6.1, we began to have memory issues in our production environment, so we looked into `jmap-histo` and found the following:

sudo -u interestservice jmap -histo:live 17183

num #instances #bytes class name
----------------------------------------------
1: 125474242 5018969680 org.jsoup.parser.ParseError
2: 346511 532368208 [Ljava.lang.Object;
3: 279172 436142624 [C
4: 25886 69010632 [B
5: 821313 26282016 java.lang.String
6: 635160 25406400 java.util.LinkedHashMap$Entry
7: 112376 15290312
8: 251069 14059864 java.util.LinkedHashMap
9: 112376 13495952
10: 264109 10817536 [Ljava.util.HashMap$Entry;
11: 9220 10611888
12: 150087 9589640

I tried to find cases where instances of `ParseError` are held in a static context, but was unable to.

For now we have rolled back to use 1.5.2. I believe this issue may also be the root case of `OutOfMemory` related issues like #132.