Query Win32_PrintJob causes spoolsv.exe to grow and brings down system?

F

F. C.

Is this causing spoolsv.exe to grow in memory? Any workaround?
==================
SELECT * FROM __InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA
'Win32_PrintJob'
==================


Finally narrow down to this -

Why the follwing few lines of codes cause spoolsv.exe keep growing / eating
memory? It checks Win32_PrintJob once every second and I guess that has
something to do with spoolsv.exe. It keeps growing and eventually bring
down
my systems (WinServer 2003 and XP home in my case)

How can I stop it from growing? Any best practice sample codes of doing
this?

Thanks

==========
Imports System
Imports System.Management
.......

Dim watcherPrintJob As ManagementEventWatcher
Dim scope As New ManagementScope("root\CIMV2")
Dim qryPrintJob As New WqlEventQuery("SELECT * FROM
__InstanceCreationEvent WITHIN 1 WHERE TargetInstance ISA 'Win32_PrintJob'")
watcherPrintJob = New ManagementEventWatcher(scope, qryPrintJob)
watcherPrintJob.Start()
scope = Nothing
qryPrintJob = Nothing
watcherPrintJob.Dispose()
===================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top