Garbage collection occurs when the user is not running any code. For example, in a window when you click a button,
the VM runs the clicked event, when the invocation returns, the vm runs garbage collection. The only other time it happens
is when you call the function of course.
2.) Is it possible to run
into problems when calling GarbageCollect() explicitly ?
If someone thinks they have
found a bug then they should certainly submit it as a p1 to our Support
Organization. It is possible
that bugs could exist when calling gc since there is no way we could test
every timing situation of
the invocation of gc.This is the reason for having an explicit time for
gc to run.
That has been very well
tested.
3.) Are there known Problems
with GarbageCollect() ?
When calling the GarbageCollect()
function in the constructor event of a non visual
userobject the function
destroys objects that are referenced.
Workaround: Create a user
defined event , call the GarbageCollect() in the user event and finally
post
the user event in the constructor
event of the nvo.
4.) Is it possible to switch
off garbage collection at all ?
No, it is not possible.
It's not advisable. If you turn it off, memory never goes away.
You can effectively do that
by setting the timeout to a huge number of seconds using the
GarbageCollectSetTimeLimit
() function.
But again, memory for the
groups or stale objects will NEVER go away unless you call gc.

Back to Top