Does converting to a string(i.e .toString() ) consumes lots of memory or even leads to memory leak?If yes.then is there any way to handle this? I think when i am parsing pdf text to simple text my program is consuming lot of memory, dont know if this is the reason.
PS: I am using itext to parse the pdf
If you have a large pdf, then yes it does consume a lot of memory. The only solution i can see is divide you pdf into smaller ones and then run your operations on each one. Finally, regroup the results
UPDATE :
While googling, I found that you CAN split pdf using itext library, check these links:
http://viralpatel.net/blogs/2009/06/itext-tutorial-merge-split-pdf-files-using-itext-jar.html
http://sanjaal.com/java/448/java-pdf/splitting-pdf-file-using-java-itext-api-into-multiple-pdfs/