Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to decrease the user objects and Handles for console application
    text
    copied!<p>I am having the console application which creates the PDF for a set of records. For if the count is 9000 above an error occurred that "Error creating window Handle". In the application level i am using 6 threads.</p> <p>As i observed in the Task Manager the Handles are increasing and the user objects are also increasing.</p> <p>I have written the obj.Dispose method where ever i have created the object. So now my question is how to decrease the user objects and Handles.</p> <p>I am using the console application with 3.5 Framework in C#.</p> <p>Update:</p> <p>Below is the code which i have used</p> <pre><code>Thread FirstTreadPDFs = new Thread(() =&gt; objPDFsProcess.DoGeneratePDFsProcess()); </code></pre> <p>FirstTreadPDFs.Start();</p> <p>//Thread2 Thread SecondTreadPDFs = new Thread(() => objPDFsProcess.DoGeneratePDFsProcess()); SecondTreadPDFs.Start();</p> <p>//Thread3 Thread ThirdTreadPDFs = new Thread(() => objPDFsProcess.DoGeneratePDFsProcess2()); ThirdTreadPDFs.Start();</p> <p>//Thread4 Thread FourthTreadPDFs = new Thread(() => objPDFsProcess.DoGeneratePDFsProcess()); FourthTreadPDFs.Start();</p> <p>//Thread5 Thread FifthTreadPDFs = new Thread(() => objPDFsProcess.DoGeneratePDFsProcess1()); FifthTreadPDFs.Start();</p> <p>FirstTreadPDFs.Join(); SecondTreadPDFs.Join(); ThirdTreadPDFs.Join(); FourthTreadPDFs.Join(); FifthTreadPDFs.Join();</p> <pre><code> DataSet dsHeader1 = new DataSet(); //Pending Cusotmers need to get to generate PDFs dsHeader1 = objCustStatementDAL.GetCustStatementdetailsForPDF(IsEDelivery, 1); if (dsHeader1 != null &amp;&amp; dsHeader1.Tables.Count &gt; 0) { if (dsHeader1.Tables[0].Rows.Count &gt; 0) { writerLog.WriteLine(DateTime.Now + " Trying to get Pending Records"); objPDFsProcess.DoGeneratePDFsProcess2(); writerLog.WriteLine(DateTime.Now + " Exit Trying to get Pending Records block"); } } dsHeader1.Dispose(); </code></pre> <p>After executing 9000+ records the Exit Trying line is executing and stopping the application.</p> <p>Where ever i use the object i placed Dispose method.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload