GarbageCollectSetTimeLimit

Description

Sets the minimum interval between garbage collection passes.

Syntax

GarbageCollectSetTimeLimit ( newtimeinmilliseconds )

Argument

Description

newtimeinmilliseconds

A long (in milliseconds) that you want to set as the minimum period between garbage collection cycles.

If null, the existing interval is not changed.


Return value

Long.

Returns the interval that existed before this function was called. If newTime is null, then null is returned and the current interval is not changed.

Usage

Specifies the minimum interval between garbage collection passes: garbage collection passes will not happen before this interval has expired. Garbage collection can effectively be disabled by setting the minimum limit to a very large number. If garbage collection is disabled, unused classes will not be flushed out of the class cache.

Examples

This example sets the interval between garbage collection passes to 1 second and sets the variable OldTime to the length of the previous interval:

long OldTime, NewTime
NewTime = 1000 /* 1 second */
OldTime = GarbageCollectSetTimeLimit(NewTime)

See also

GarbageCollect

GarbageCollectGetTimeLimit