Here's a segment of my code.
PDFRenderer pdfRenderer = new PDFRenderer(pdDoc);
BufferedImage image = pdfRenderer.renderImageWithDPI(page-1, 300,ImageType.GRAY);
//some codes 1
//some codes 2
When I debugged this code, i saw that just after the line renderImage withDPI ,control reaches finally and just after finally I get out of memory error. After the buffered image line ideally control sgould execute "some codes 1" which are just after that line but instead control skips all that and reaches finally, it doesnt even go to catch , so I cant understand why is this happening.
Please provide some insight on this.