B
Benny
I am having a memory problem with my application. Plain and simple all
the program does is runs through a bunch of images and prints them to a
PCL Printer. The first part of the application that I am noticing the
memory increase is when its scanning the specified directory I get an
error like this:
ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context
0x1b1a58 to COM context 0x1b1bc8 for 60 seconds. The thread that owns
the destination context/apartment is most likely either doing a non
pumping wait or processing a very long running operation without
pumping Windows messages. This situation generally has a negative
performance impact and may even lead to the application becoming non
responsive or memory usage accumulating continually over time. To avoid
this problem, all single threaded apartment (STA) threads should use
pumping wait primitives (such as CoWaitForMultipleHandles) and
routinely pump messages during long running operations.
If I have a smaller amount of images to print the printing *starts*
without any errors. After my application starts printing the memory
eventually gets up to an insane amount (ive seen it up to >300MB) and
then crashes. I am using a helper class that uses the ThreadPool object
to print several documents at a time. It simply acts as a event-driven
WorkQueue with WorkItem objects that contain the information the queue
is to process. I am trying to dispose of objects such as graphics and
PrintDocument but I am still getting this problem. If anyone can help I
would greatly appreciate it.
the program does is runs through a bunch of images and prints them to a
PCL Printer. The first part of the application that I am noticing the
memory increase is when its scanning the specified directory I get an
error like this:
ContextSwitchDeadlock was detected
Message: The CLR has been unable to transition from COM context
0x1b1a58 to COM context 0x1b1bc8 for 60 seconds. The thread that owns
the destination context/apartment is most likely either doing a non
pumping wait or processing a very long running operation without
pumping Windows messages. This situation generally has a negative
performance impact and may even lead to the application becoming non
responsive or memory usage accumulating continually over time. To avoid
this problem, all single threaded apartment (STA) threads should use
pumping wait primitives (such as CoWaitForMultipleHandles) and
routinely pump messages during long running operations.
If I have a smaller amount of images to print the printing *starts*
without any errors. After my application starts printing the memory
eventually gets up to an insane amount (ive seen it up to >300MB) and
then crashes. I am using a helper class that uses the ThreadPool object
to print several documents at a time. It simply acts as a event-driven
WorkQueue with WorkItem objects that contain the information the queue
is to process. I am trying to dispose of objects such as graphics and
PrintDocument but I am still getting this problem. If anyone can help I
would greatly appreciate it.