DotNetGarbageCollectionInterval Property

TestStand 2019 Help

Edition Date: May 2019

Part Number: 370052AA-01

»View Product Info
Download Help (Windows Only)

Syntax

Engine.DotNetGarbageCollectionInterval

Data Type

Long

Purpose

Specifies the interval, in milliseconds, at which TestStand forces .NET garbage collection. Set this property to a value less than or equal to 0 to disable automatic garbage collection by the TestStand Engine. By default, in applications that use the TestStand ApplicationMgr control, this value is set to 3000 (3-second interval). In applications that do not use the ApplicationMgr control, this property is set to -1. Forcing garbage collection at regular intervals reduces memory usage and improves performance by ensuring that TestStand objects that have previously been referenced in .NET code are promptly freed or marked for reuse.

Remarks

If you use the default interval setting and notice constant CPU usage for the garbage collection the garbage collection timer performs, the following issues are the most likely causes:

  • A significant number of managed objects (on the order of tens of millions or more)–If you have too many managed objects, increase the garbage collection interval.
  • Leaking managed objects–Managed objects can leak as a result of unexpected unreleased references, such as references incurred when you add an event handler with an instance method. Use .NET leak detection tools to identify unreleased references.

Note  The garbage collection this property handles applies only to the version of the .NET Common Language Runtime (CLR) the TestStand Engine uses directly. If you are using a different version of the .NET CLR for a user interface, implement a timer for garbage collection in which you call the .NET Framework GC.Collect method to collect objects from that version of the .NET CLR.


See Also

Engine.DoDotNetGarbageCollection

WAS THIS ARTICLE HELPFUL?

Not Helpful