java.lang.OutOfMemoryError: Java heap space
I am getting this error when I am trying to parse an xml file which is about 1.2 gb. So i was going through the forums and checked on how to solve the error, and so someone posted a solution to include the following vm arguments" -Xms512M -Xmx1024M" and I still get the error?
Can some help me with these please?
Thanking you,
Shishir Shah
This makes sense to me. 1024mb = 1gb. Your file is 1.2 gb, so right off the bat, you are short. Second, how are you parsing? I am assuming DOM, since memory is part of your issue. DOM requires even more space than the actual raw XML file.
The solution to parsing large documents like this is to not use DOM at all. (Really, how good idea do you think it is that your app takes up a gigabyte of memory just to parse a file?) Use SAX. That's where its strengths lie.
- Saish
Saisha at 2007-7-13 12:00:16 >

Hey,Thanks a lot. You were right. I was using dom. This is like a huge project I was doing and I was under the impression I was using Sax as that is what I have used at most places. Thanks again,Shishir