"Bob Smith" <BobSmith@xxxxxx> wrote in message
news:C797CC53-5638-4B87-BBDB-CCFC6FA5154F@xxxxxx
>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,
> I
> also have Many objects that perform differing tasks (open CDO mailboxes
> with
> CDO, send emails, open databases etc). It's probably not the cleanest
> code,
> but it gets the job done. I will not post the code as it is very long and
> not
> 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
> "Al Dunbar" wrote:
>
>>
>> "Bob Smith" <BobSmith@xxxxxx> wrote in message
>> news:B93BD40F-4994-488B-8A24-E5C77ABC55E0@xxxxxx
>> >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
>> memory
>> by REDIM'ing arrays, creating unnecessary objects, or doing some sort of
>> string concatenation that does not properly release memory. What,
>> precisely
>> is your script doing? If short, try posting it here.
>>
>> /Al
>>
>>
>>