Creates a new in-memory cache

Namespace: BrightstarDB.Caching
Assembly: BrightstarDB (in BrightstarDB.dll) Version: 1.9.0.0 (1.9.0.0)

Syntax

C#
public MemoryCache(
	long cacheSize,
	ICacheEvictionPolicy cacheEvictionPolicy,
	long highwaterMark = 0,
	long lowwaterMark = 0
)
Visual Basic
Public Sub New ( 
	cacheSize As Long,
	cacheEvictionPolicy As ICacheEvictionPolicy,
	Optional highwaterMark As Long = 0,
	Optional lowwaterMark As Long = 0
)
Visual C++
public:
MemoryCache(
	long long cacheSize, 
	ICacheEvictionPolicy^ cacheEvictionPolicy, 
	long long highwaterMark = 0, 
	long long lowwaterMark = 0
)
F#
new : 
        cacheSize : int64 * 
        cacheEvictionPolicy : ICacheEvictionPolicy * 
        ?highwaterMark : int64 * 
        ?lowwaterMark : int64 
(* Defaults:
        let _highwaterMark = defaultArg highwaterMark 0
        let _lowwaterMark = defaultArg lowwaterMark 0
*)
-> MemoryCache

Parameters

cacheSize
Type: System..::..Int64
The maximum size of the cache in bytes
cacheEvictionPolicy
Type: BrightstarDB.Caching..::..ICacheEvictionPolicy
The eviction policy to use to maintain the cache size
highwaterMark (Optional)
Type: System..::..Int64
The cache size (in bytes) that will trigger the cache eviction policy to run
lowwaterMark (Optional)
Type: System..::..Int64
The cache size (in bytes) that the eviction policy will attempt to achieve when it is run

See Also