Garbage Collector Sample

This document contains the release information for the NGWS Garbage Collector sample.  You will find the following sections below:

 

 

Sample Overview

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…

·         Type NMAKE All from the command line.

For Example:

C:\Program Files\NGWSSDK\Samples\GC\:>NMAKE All

 

Running the Sample

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

For Example:

C:\Program Files\NGWSSDK\Samples\GC\:>GC