"Bob Smith" <BobSmith@xxxxxx> wrote in message
>I would refer to this script as more like an application than a script. I
> like to push VB script to it's limits. Yes I do have arrays that I redim,
> also have Many objects that perform differing tasks (open CDO mailboxes
> CDO, send emails, open databases etc). It's probably not the cleanest
> but it gets the job done. I will not post the code as it is very long and
> well documented.
Thanks for not posting ;-)
The answer seems to lie in this sentence: "It's probably not the cleanest
code, but it gets the job done". At some point you might find that your
"unclean" code will start failing to get the job done or causing other
problems because it is not cleaning up after itself by releasing resources
it has taken control of.
You could analyze your code looking for objects not set to nothing, objects
whose methods allow resources to be released (i.e. .close), iterative text
concatenation, and arrays redimmed ad infinitum, and address the specific
issue in each case. Hopefully your script (er, I mean "application") is well
enough structured that this can be done without radical surgery.
Of course, even if you were to do this, it would not guarantee that your
script would be free from resource issues. I don't know how good vbscript is
at garbage collection.
> "Al Dunbar" wrote:
>> "Bob Smith" <BobSmith@xxxxxx> wrote in message
>> >I have a script I wrote that basically performs a loop indefinably using
>> > wscript.sleep. The script performs the same action over and over again
>> > every
>> > 10 minutes. What is interesting to me however; if I fire the script off
>> > using
>> > cscript.exe it initially uses about 8MB or ram (as shown in the task
>> > manager). After the script has been running 4 - 5 days I checked again
>> > and
>> > it's using 500k. It seems strange to me that this would happen. Is this
>> > normal behavior?
>> That depends.
>> This should be considered normal behaviour for a script that consumes
>> by REDIM'ing arrays, creating unnecessary objects, or doing some sort of
>> string concatenation that does not properly release memory. What,
>> is your script doing? If short, try posting it here.