Hi Mike, Thanks a lot for your valuable reply. Its working with PdfWriter.releaseTemplate().
Pradeep -----Original Message----- From: Mike Marchywka [mailto:marchy...@hotmail.com] Sent: Tuesday, March 24, 2009 5:51 PM To: itext-questions@lists.sourceforge.net Subject: Re: [iText-questions] OutOfMemoryError when PdfTemplate is used Get more memory? LOL I'm responding not with a specific answer but because your question unfortunately typifies all the problems I've associated with PDF applications as seen by end users. When an Acrobat Reader ties up my CPU in an infinite loop or even finite but extensive processing, or takes all my memory, the usual response from anyone on the other side of the fence is " you need more CPU or memory etc, don't be cheap etc" Essentially you express surprise that a document of unbounded size can not be processed and you first tried to fix the problem the easy way, an approach I myself often take rather than hunt down a memory leak ( and usually this will limp along for a while). I guess in this case the strategy is to look for common patterns or constructs in java that require someone to hold on to references until there is an explicit call to something like release ( after of course looking for task/application specific features that would cause you to buffer everything in memory LOL). In this case, I just grepped the source code for "memory" and does look like there are reasonably good comments about this issue in many places. "Release" is often used and the code is pretty well written so you can go through and find methods that may use this name, 518 for f in `cat xxx`; do grep " public .*(" "$f" ; done> fff make a vocabulary list ( again, names are easy to parse mostly ), 522 cat fff | sed -e 's/(.*//' | sed -e 's/public//' | sed -e 's/\([a-z]\)\([A-Z]\)/\1 \2/g' | freqassoc> ggg or, if you look for "release", 526 cat fff | sed -e 's/(.*//' | sed -e 's/public//' | grep -i release static PdfObject getPdfObjectRelease static PdfObject getPdfObjectRelease PdfObject getPdfObjectRelease void releaseLastXrefPartial static void releaseLastXrefPartial PdfDictionary getPageNRelease void releasePage void resetReleasePage PdfDictionary getPageNRelease PRIndirectReference getPageOrigRefRelease void releasePage void resetReleasePage void releaseTemplate > > This code runs well up to 1000 pages and gets "Exception > in thread "main" java.lang.OutOfMemoryError: Java heap space" > for more number of pages. > > I have increased Java heap size to 512Mb. Works fine up to > 5000 pages and again same error. > > So please suggest me creating PDF (which would contain more > than 30,000 pages) using pdfTemplate. > > > > > > > Mike Marchywka 586 Saint James Walk Marietta GA 30067-7165 415-264-8477 (w)<- use this 404-788-1216 (C)<- leave message 989-348-4796 (P)<- emergency only marchy...@hotmail.com Note: If I am asking for free stuff, I normally use for hobby/non-profit information but may use in investment forums, public and private. Please indicate any concerns if applicable. Note: hotmail is getting cumbersom, try also marchy...@yahoo.com _________________________________________________________________ Express your personality in color! Preview and select themes for Hotmail(r). http://www.windowslive-hotmail.com/LearnMore/personalize.aspx?ocid=TXT_M SGTX_WL_HM_express_032009#colortheme ------------------------------------------------------------------------ ------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender by email reply and delete it from your system. The integrity and security of this email cannot be guaranteed on the Internet. ------------------------------------------------------------------------------ Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are powering Web 2.0 with engaging, cross-platform capabilities. Quickly and easily build your RIAs with Flex Builder, the Eclipse(TM)based development software that enables intelligent coding and step-through debugging. Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php