Hi Giles,
There are many ways to look at this and different people will give you
different responses. What that line in essense is doing is freeing up any
associated memory at was being used. The practise of cleaning up is
essential in languages such as C to avoid memory leaks - for example in the
following program.
1. Create a pointer to a blog of memory
2. Assign data to the blog of memory using the pointer
3. Use the data in the blog of memory using the pointer
4. Goto step 1
In the above example, step 4 takes you to the bigging at which point the
pointer would be changed to a different memory block but leaving the
original memory still in use and lost - this in essense is a memory leak.
This memory would eventually be freed but only when the process had
completed.
Now, argubly in languages such as VB, there are better controls to prevent
you from doing this and in your case when the scripting engine had finished
processing (when the page is delivered) such pointers and / or memory
allocation would be freed anyway. That's not to say things won't change in
the future however but I doubt it.
Long story short - although not specifically needed, get into the habbit of
cleaning up. Imagine you had a script that created 10 variables and stuck
100MB of data in each one, that would be 1GB of memory taken up until the
script finished. If you cleaned up the variabled you didn't need when you'd
finished you could use less memory.
Hope this makes sense...
Regards,
Jon
www.insidetheregistry.com