0

I have a big XML file that I am parsing using SAX parser. During the processing I create a big HashMap having key and values for parsed JSON.

As per my understanding, in java 8 you dont need to set any Permgen setting while running java application, it creates Strings in Heap but some how I am still getting OutOfMemoryError. Is my understanding right or I am choosing a wrong parser?

5
  • pls add more details. your heap size, the size of the data and where in the code do you think the OOM is coming. Commented Apr 30, 2016 at 16:19
  • String were always stored in the heap, in Java 8 the MetaSpace replaced the PermGenSpace but that rarely matters : PermGenSpace was used to store class declarations, and while I'm not very knowledgeable about MetaSpace I'm pretty sure you rarely have to tweak it Commented Apr 30, 2016 at 16:21
  • Hi Aaron and Abhishek, thanks for the response. I thought string were part of runtime constant pool which is similar to heap but not exactly. What else do you think, I should try? Commented Apr 30, 2016 at 16:26
  • Also, do you think if it matters to look into what GC I will be using? Commented Apr 30, 2016 at 16:27
  • I guess you're referring to the String literal pool. Most probably in your SAX handler, you would be creating objects rather than literals. Again, it's all speculation without any details in the question. Commented Apr 30, 2016 at 16:35

1 Answer 1

1

You should take a look into the following -

  1. Which garbage collection you are using.

  2. If you are using IDE, check if you are using correct java version. Sometimes you IDEs can have setting to run on specific JVM.

Which java installation you are using, BTW?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.