From: Joel on
Hi,
I am having trouble with java in Matlab. I have written a java class that use the XMLStreamReader: http://java.sun.com/webservices/docs/1.5/api/javax/xml/stream/XMLStreamReader.html

In my compiled java class " ReadXMLPhys" I use:
in = new FileInputStream(infile);
factory = XMLInputFactory.newInstance();
factory.setProperty("javax.xml.stream.isCoalescing",true);
parser = factory.createXMLStreamReader(in);

And then when I am finished I use
parser.close();
in.close();

I open an instance to the java objects in a matlab function:

JavaObj = ReadXMLPhys();

and this java object is cleared when exiting the function.

The problem is that when I use the same function again on a new file it seems as if the new file is not loaded and that I am currently standing at the point in the old file where I used the close() methods.

If I type "clear java" in Matlab it works but then I clear evrything, so that is not what I want. Can I somehow clear only the java heap?

/Joel