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()
===================
==================
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()
===================