Quantcast
Channel: .NET Framework Class Libraries forum
Viewing all articles
Browse latest Browse all 8156

System.Printing Printqueue.AddJob methods consumes memory and doesnt releases once the document is printed.

$
0
0

Hi All,

I am Using System.Printing library in my application with .net framework 3.5. When i Print job on any printer using PrintQueue.AddJob memory gets increased and doesnt releases it. Memory is released only if the application is closed.

If i print mre than 10 jobs then my application uses all the memory of my computer and finally everything gets slows down.

I obeserved the memory usage goes to 2GB, which is not acceptable.

After investigation i found that Memory gets increased when PrintqQueue.AddJob method is invoked.

Here is my sample Code for printing:

PrintServer printServer = newPrintServer(@"\\sshinde");

PrintQueue PrintQ = newPrintQueue(printServer, "HP_Printer"PrintSystemDesiredAccess.AdministratePrinter);

PrintQ.AddJob("xyz"@"C:\ProgramData\MyComapny\PrintSoftware\Config\Print_Manager\INPUT\d7a8a71b-4e73-43ec-8ee9-bbe24b3ba2cb.xps"false);


  



Viewing all articles
Browse latest Browse all 8156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>