Execution

After the native code is generated, it is run on the target platform. This is when garbage collection, a very important activity, is performed.

Garbage Collection

Resource management in a program can be quite a complicated task. Typically, a program utilizes a number of resources, such as database records, network connections, screen space, and so on. In an object-oriented environment, a number of types exist, each representing a different resource.

The steps involved in managing these resources are as follows:

1.
Allocate memory for the type that represents the resource.
2.
Initialize the resource. This represents the initial state of the resource. It also makes the resource usable.
3.
Access the instance members of the type ...

Get Special Edition Using C# now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.