Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Possible Memory leak with ParseError #159

Closed
erraggy opened this Issue · 8 comments

7 participants

@erraggy

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  <constMethodKlass>
   8:        251069       14059864  java.util.LinkedHashMap
   9:        112376       13495952  <methodKlass>
  10:        264109       10817536  [Ljava.util.HashMap$Entry;
  11:          9220       10611888  <constantPoolKlass>
  12:        150087        9589640  <symbolKlass>

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.

@jiminoc

confirmed this issue as well

@dwhitney

yeah I'm seeing the same thing. Memory problems went away when I downgraded to 1.5.2

@erraggy

BUMP

@cadams500

+1 vote

@jiminoc

+1 also, big problem

@Malax

It seems that the patch from issue #160 fixes the problem.

@jhy
Owner

Thanks -- I've fixed this, and made the error tracking useful, by defaulting error tracking to off, and by providing a mechanism to enable and retrieve error reports. I intend on tweaking it to support a max tracked error count, also.

Fixed in the next release (which will be 1.6.2). Apologies for the problems caused.

@jhy jhy closed this
@vidoshsahu

Hi,

I was using jsoup 1.6.3 for a frequent bulk html parsing. But there were very high memory consumption. Then I switched to 1.5.2, but still the problem is there. Here is the memory dump (with 1.6.3) -

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
1981 ec2-user 20 0 3300m 1.9g 1796 S 0.0 25.4 53:24.95 java

num #instances #bytes class name

1: 17325 1210098560 [B
2: 42759 95880576 [I
3: 732772 69722232 [C
4: 739136 36450736 [Ljava.lang.String;
5: 657138 21028416 java.lang.String
6: 219957 8798280 java.util.LinkedHashMap$Entry
7: 161524 7623144 [Ljava.lang.Object;
8: 194347 6219104 java.util.LinkedList$ListItr
9: 143441 6066224 [Ljava.util.HashMap$Entry;
10: 35287 5604632
11: 63675 5603400 java.lang.reflect.Method
12: 35287 4242008
13: 67207 3763592 java.util.LinkedHashMap
14: 174602 3627048 [Ljava.lang.Class;
15: 149393 3585432 [Lorg.jsoup.nodes.Node;
16: 2905 3439776
17: 85811 3432440 org.jsoup.nodes.TextNode
18: 58846 2946328
19: 62399 2495960 org.jsoup.nodes.Element
20: 61183 2447320 org.jsoup.parser.Token$StartTag
21: 99684 2392416 org.jsoup.helper.DescendableLinkedList$DescendingIterator
22: 2905 2323048
23: 95674 2296176 java.util.ArrayList
24: 94993 2279832 org.jsoup.nodes.Attribute
25: 52933 2117320 org.jsoup.parser.Token$EndTag
26: 85141 2043384 org.jsoup.parser.Token$Character
27: 2429 1948744
28: 119902 1918432 org.jsoup.nodes.Attributes
29: 73515 1764360 java.lang.StringBuilder
30: 66819 1603656 java.util.LinkedList$Entry
31: 63062 1513488 org.codehaus.jackson.map.introspect.MemberKey
32: 16471 1247168 [S
33: 36109 1155488 org.codehaus.jackson.map.introspect.AnnotatedMethod
34: 2095 994112
35: 27449 878368 java.lang.StackTraceElement
36: 49816 797056 org.codehaus.jackson.map.introspect.AnnotationMap
37: 22576 722432 java.util.HashMap$Entry
38: 44144 706304 sun.reflect.ConstantPool
39: 10857 694848 java.util.regex.Matcher
40: 23101 554424 sun.reflect.generics.tree.SimpleClassTypeSignature
41: 10984 527232 java.nio.HeapCharBuffer
42: 10740 515520 java.nio.HeapByteBuffer
43: 14759 472288 org.codehaus.jackson.map.introspect.POJOPropertyBuilder$Node

Can you please help us out.

Thanks,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.