Re: Exception in thread "main" java.lang.OutOfMemoryError Please help!
Just in case, here's the code which is causing the error. I don't think
there's anything wrong with it as I'm sure I got it to work in the
past. I might be wrong though.
<code>
public void readFileIn(String fn){
System.out.println("Hi");
Document doc = null;
try{
DocumentBuilderFactory dbf =
DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
doc = db.parse(new File(fn));
myDoc = doc;
System.out.println("file parsed okay, thankyou");
}catch (Exception e){
System.out.println("problem parsing the file old chap");
}
}
</code>
barry_normal wrote:
Hello there,
I'm trying to do some simple text formatting, starting with a base XML
file which is about 6MB in size.
The problem I'm having is that I keep getting this message:
Exception in thread "main" java.lang.OutOfMemoryError
Java Result: 1
I've tried setting the heap size using java -Xmx512M and many other
combinations but this seems to have no effect at all.
I'm using os x 10.4.8 and Netbeans 5. My system has 4GB of RAM.
If anyone can point me to a solution I'd be very grateful
Thanks
B