AFCache Class
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
This class caches certain AF objects and collections to prevent them from untimely garbage collection.
Inheritance Hierarchy
SystemObject
OSIsoft.AF.DiagnosticsAFCache
OSIsoft.AF.DiagnosticsAFCache
Namespace: OSIsoft.AF.Diagnostics
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static class AFCache
Public NotInheritable Class AFCache
public ref class AFCache abstract sealed
[<AbstractClassAttribute>] [<SealedAttribute>] type AFCache = class end
The AFCache type exposes the following members.
Properties
| Name | Description | |
|---|---|---|
| CacheTime |
The length of time, in seconds, that AF SDK objects will be kept in the cache,
provided there is room based on the MaxObjects property.
| |
| MaxObjects |
The maximum number of objects that the AF SDK will keep in its cache at any
one time.
|
Methods
| Name | Description | |
|---|---|---|
| Clear |
Removes all items from the AF SDK's cache. These items may still be accessed by
the AF SDK up until the .NET garbage collector destroys them.
|
Remarks
The AF SDK will cache certain objects and collections for a short period of time to prevent them from
being garbage collected too soon. You can use the properties and methods of this class to control how long
and how many objects the AF SDK will cache. You can also request that the AF SDK empties its cache.