Jump to content
EduGeek EdSec 2026 is Go! 27th Oct in Derby! Join us for a day of EdTech security focused talks, networking, and an evening social ×

Recommended Posts

Posted

Hi,

 

Im using an ASP script to query WMI to monitor errors with printers and also services on 2 of the servers at our school, Its been working fine, but now im getting Code 500 errors.

 

Once i look in the IIS logs i see that the reason for it failing is either "Out_of_memory_" when restarting IIS i got "No_more_threads_can_be_created_in_the_system._" and now am getting "The_paging_file_is_too_small_for_this_operation_to_complete._" errors.

 

Obviously i now assume that the script is using too much memory (its reloaded every 10 seconds on a remote computer).

 

Is there a way around this? Ive changed the WMI query from having SELECT * to specific field names so less memory is needed, but it must me holding the object in memory somewhere, is there a way to 'destroy' it?

 

Im grateful for any suggestions,

 

Thanks, Paul.

strComputer = "." 
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colListOfServices = objWMIService.ExecQuery("SELECT Caption, Started FROM Win32_Service WHERE StartMode = 'Auto'")

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...