The SYSINTERNALS tool you are referring to is PROCMON. Great tool for tracking down internal issues in Windows.
Howard Shank ----- Original Message ---- From: Mike Marchywka <marchy...@hotmail.com> To: itext-questions@lists.sourceforge.net Sent: Tuesday, August 11, 2009 11:03:09 AM Subject: Re: [iText-questions] out of Kernel memory ---------------------------------------- > Date: Tue, 11 Aug 2009 07:47:39 -0700 > From: hgshank > To: itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] out of Kernel memory > > If the files are being written to a different server and that server > experiences memory issues, then it obviously is something to do with windows > and the way it's handling the files and not an iText issue. > > Perform a memory leak dump analysis on the process while it is running using > DebugDiags and select the process. You can do select the process and do a > full dump and then analyze the dmp file to determine where the leak is being > created. I was going to suggest the heap analaysis tool when I thought this was an issue with java :) I'm not even sure of the details here but is there a "close" for the file? IIRC in the past when I don't explicitly call close in some cases that should flush/close when reference count goes to zero I've gotten incomplete files etc. If you believe it to be handle related, there is a sysinternals tool ( handle IIRC) for checking for open files etc. Sometimes resource depletion messages are not literal ( "out of memory" could mean out of some related thing, I think I've seen if for GDI's or something). > > Regards, > Howard Shank > > > > ----- Original Message ---- > From: "Kobty, Joseph" > To: Post all your questions about iText here > Sent: Tuesday, August 11, 2009 10:30:47 AM > Subject: Re: [iText-questions] out of Kernel memory > > Change your test to the following and let it run for a few minutes and you > will see the kernel memory climb > It does not happen in your example because you are writing to the same file > name each time. Seems to be as the number of files generated increases, the > problem occurs. > Another interesting observation, The kernel memory increases out of control > on the server where the files are being written to, not on the server where > the application is running. This is what was throwing me off to think it is > related to IIS or console application. Try the test below and let it run for > a few minutes, eventually it will run out of kernel memory. The only > modification to you code is that I am generating a different file for each > loop iteration. > for (int i = 0; i < 1000000; i++) > { > > Document pdfDocument = new Document(); > String outputPath = @"c:\test"; > String reportName = "test" + i.ToString() + ".pdf"; > FileStream strm = new FileStream(Path.Combine(outputPath, reportName), > FileMode.Create); > > PdfWriter writer = PdfWriter.GetInstance(pdfDocument, strm); > > pdfDocument.Open(); > > pdfDocument.Add(new Paragraph("test")); > > pdfDocument.Close(); > > } > > -----Original Message----- > From: Paulo Soares [mailto:psoa...@glintt.com] > Sent: August 10, 2009 5:03 PM > To: Post all your questions about iText here > Subject: Re: [iText-questions] out of Kernel memory > > I have this code running and all is ok. > > for (int i = 0; i < 1000000; i++) { > > Document pdfDocument = new Document(); > > FileStream strm = new FileStream("c:\\atp.pdf", FileMode.Create); > > PdfWriter writer = PdfWriter.GetInstance(pdfDocument, strm); > > pdfDocument.Open(); > > pdfDocument.Add(new Paragraph("test")); > > pdfDocument.Close(); > > } > > Paulo > > ----- Original Message ----- > From: "Kobty, Joseph" > To: "Post all your questions about iText here" > > Sent: Monday, August 10, 2009 9:32 PM > Subject: Re: [iText-questions] out of Kernel memory > > > Yes I am using V4.1.6. > The .NET I have installed has version 2.0.50727.42 > Which I believe has the latest service packs. > > > -----Original Message----- > From: Paulo Soares [mailto:psoa...@glintt.com] > Sent: August 10, 2009 4:16 PM > To: Post all your questions about iText here > Subject: Re: [iText-questions] out of Kernel memory > > Are you using iTextSharp 4.1.6? If you are using .NET 2.0 without SP1 you > may have leaks due to leaks in the framework. > > Paulo > > ----- Original Message ----- > From: "Kobty, Joseph" > To: > Sent: Monday, August 10, 2009 8:46 PM > Subject: [iText-questions] out of Kernel memory > > > Hi > I am creating PDF documents on the fly using iTextSharp. I noticed that the > server where I am running this process runs out of Kernel memory (System > memory) > After about 50,000 files. I commented out all the code to see what is > causing it, and it seems the mere fact of opening a PDF document and writing > something simple like "test" and then closing it, uses a bit of kernel > memory each time which is never released, so as thousands of files are > created the kernel memory usage keeps climbing until my server finally shuts > down and reboots. Seems to be done by the simple action of opening and > closing a pdf document. > > For (int I = 0; I < 100000; i++) > { > Document pdfDocument = new Document(); > String outputPath = @"C:\"; > String reportName = "test" + i.ToString() + ".pdf"; > using (FileStream strm = new FileStream(Path.Combine(outputPath, > reportName), FileMode.Create)) > { > PdfWriter writer = PdfWriter.GetInstance(pdfDocument, strm); > pdfDocument.Open(); > pdfDocument.Add(new Paragraph("test")); > strm.Close(); > writer.Close(); > pdfDocument.Close(); > } > } > Joseph Kobty > Team leader/Business analyst > > MediSolution Ltd. | A Brookfield Asset Management Company > 5915 Airport Road, Suite 810, Mississauga, Ontario, L4V 1T1 > Tel 905.673.4100 ext 4042 > joseph.ko...@medisolution.com | > www.medisolution.com > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > 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 > 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/ > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > 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 > 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/ > > > > > > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > 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 > 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/ _________________________________________________________________ Get free photo software from Windows Live http://www.windowslive.com/online/photos?ocid=PID23393::T:WLMTAGL:ON:WL:en-US:SI_PH_software:082009 ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ 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 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/ ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ 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 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/