1

I have a simple VBScript that's iterating through all COM+ apps and starting the ones that are queued. This runs every half hour. My server has 2.5gb of memory. Then after about 3 full days of this, I get an "Out of memory" error from Windows Script Host. However, it seems the server memory is fine. Around 1gb free.

This is what my script looks like;

dim cat 
Dim apps
Dim app

set cat = CreateObject ("COMAdmin.COMAdminCatalog") 

set apps = cat.getcollection("Applications")
apps.populate

for each app in apps
  if app.Value("QueuingEnabled") then
    cat.StartApplication (app.name) 
  end if
next

Last time I got this error it reported line #7; set apps = cat.getcollection("Applications") as the place it ran out of memory. Does anyone have any suggestions on how to fix this problem? I have very little experience with COM+, so it's hard for me to see what's consuming memory here. There are only about 8 COM+ apps running on the server, and they are not at all large.

Any help here would be greatly appreciated.

1 Answer 1

1

I think you need:

Set app = Nothing
Set apps = Nothing
Set cat = Nothing

at the end of your script.

See http://support.microsoft.com/kb/304713 for an example of how to use the COMAdmin.COMAdminCatalog object.

Sign up to request clarification or add additional context in comments.

2 Comments

I just found out I had let "procmon" running, that's what it was. The 'nothing' declarations are good habits though, I'll give you the answer here :]
See Eric Lippert's When Are You Required To Set Objects To Nothing? for an interesting dicussion on the Set var = Nothing practice. The surprising answer is: almost never.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.