Hi all,
My task is to check the file contents with the format which is defined in XML.
so,initially i used DOM Parser and the following code.
File file = new File("c:\sample.txt"); // sample.txt has >20,00,000 lines
FileReader fileReader = new FileReader(file);
BufferedReader = new BufferedReader(fileReader);
String contents;
while((contents=br.readLine())!=null){
process(contents) //Method that will parse the XML and compare with the contents
}
I get the above mentioned Exception.
I thought it might be because of DOM Parser.so,i changed to SAX Parser.even then i have the same exception.
But,when i just print the contents of the file without calling the method
process().I don get this exception.
NOTE : I tried giving [B]-Xmx**m.i need to giv different values for the heap memory and that is not allowed.[/B]
Can anyone provide me a solution?
Thanks in advance
Senthil