Defines that no more than a specified number of bytes are allowed to be used by live instances of Types that matches the provided name (and optionally their subclasses) when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

Namespace:  SciTech.NetMemProfiler
Assembly:  MemProfiler2 (in MemProfiler2.dll)

Syntax

C#
public void MaxBytes(
	string typeName,
	bool includeSubclasses,
	long byteCount
)
Visual Basic
Public Sub MaxBytes ( _
	typeName As String, _
	includeSubclasses As Boolean, _
	byteCount As Long _
)
Visual C++
public:
void MaxBytes(
	String^ typeName, 
	bool includeSubclasses, 
	long long byteCount
)

Parameters

typeName
Type: System..::..String
The type name of the instances that should be checked.
includeSubclasses
Type: System..::..Boolean
Indicates whether instances of subclasses of the specified types should be checked.
byteCount
Type: System..::..Int64
Defines the maximum number of bytes that are allowed to be used by live instances of the specified types.

Remarks

Calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will allow up to byteCount bytes to be used by live instances of the specified types. If more than byteCount bytes are used by live instances, then calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will fail.

See Also