Out of Memory Error while parsing XML file
Hello,
I am working on a program to parse an XML file and get data from it. I am using SAX Parser.
The problem is when i give the file name to the parser, it gives out of memory error. The file size is 20MB.
Is there a way to rectify this error?
I am sorry if this question is already posted in this forum.
Thanks and Regards,
Prasanna.
Probably you are hitting the default 64MB limit on the Java object heap.
You don't say which JRE you are using or what your command line arguments are, but if you are just using the Sun JRE with no arguments on a desktop machine, you are limited to 64MB of heap. You can watch the heap fill up with the -XX:+PrintGCDetails
command line argument. You can increase the maximum size of the heap with the -Xmx
flag, for example, raising the maximum to 128MB with -Xmx128m