NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Garbage Collector Sample

The purpose of this sample is to introduce developers to the garbage collector in NGWS. The garbage-collected heap manages all class object. This heap monitors the lifetime of objects and frees them only when no part of the program references the objects. This ensures that objects never leak and references to objects are always valid. This sample demonstrates how the garbage collector works. In addition, this sample shows how to properly design classes that work well in a garbage-collected environment. Finally, the sample shows how an application can control some of the garbage collector’s behavior. For example, the sample shows how to force collections, how to promote objects, and how to work with weak references to objects.

Location of the Sample

This sample list located in the GC directory of the NGWS SDK sample directories.

For Example:

C:\Program Files\NGWSSDK\Samples\GC

Building the Sample

In order to properly build and run this sample, the following steps need to be performed prior to building and running the sample.

Running the Sample

In order to run this sample, follow the instructions listed below.