---------------------------------------- > Date: Fri, 8 May 2009 09:17:46 +0200 > From: [email protected] > To: [email protected] > Subject: Re: [iText-questions] Problem of memory leak in multi threaded > environment. > > Umesh.Patel wrote: >> Hi, >> >> In our application we are using multiple threads for the generation >> of reports through Jasper report. Each thread generates one report and >> export it as a PDF file. >> >> We are facing severe problem of memory leak and when we used >> profiler we found out that there are several *com.lowagie* classes >> involved. One of the examples is, >> >> - com.lowagie.text.pdf.IntHashtable$IntHashtableEntry [ ] >> - com.lowagie.text.pdf.IntHashtable >> - com.lowagie.text.pdf.BidiLine >> >> It is a great chance that when one thread is involved in the >> generation of report, it loads Static variable containing some object >> references. And once thread completes report generation, this static >> reference keep occupying heap. As, this is of no use it should be >> released. But with each thread processing its size goes on increasing >> until JVM goes out of memory. This is just an assumption which is made >> by analyzing profiler output. >> >> Any help would be highly appreciable. > > I'll look into it, but I'm surprised when I see the classes that are > involved. Class IntHashtable is a class that is very basic. It's also > used in Apache Commons and many other tools. I don't think that's the > source of any memory leak. > > More info about a specific static variable being loaded would be > appreciated.
Static collections of strong references have their uses but normally they assume some certain class lifetime or need to be curated. What kinds of things are supposed to survive from a document and be visible to another? Off hand, I would guess you could load things like fonts maybe that you will use a lot etc. I think in the past when this has come up the poster didn't call release () on the offending object. Presumably you have verified that your application code isn't holding useless strong references to obsolete document objects? _________________________________________________________________ HotmailĀ® goes with you. http://windowslive.com/Tutorial/Hotmail/Mobile?ocid=TXT_TAGLM_WL_HM_Tutorial_Mobile1_052009 ------------------------------------------------------------------------------ The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your production scanning environment may not be a perfect world - but thanks to Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 Series Scanner you'll get full speed at 300 dpi even with all image processing features enabled. http://p.sf.net/sfu/kodak-com _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Buy the iText book: http://www.1t3xt.com/docs/book.php Check the site with examples before you ask questions: http://www.1t3xt.info/examples/ You can also search the keywords list: http://1t3xt.info/tutorials/keywords/
