Defines that no more than a specified number of bytes are allowed to be used by new live instances of any type in the provided typeSet when this definition is asserted using MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread).

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

Syntax

C#
public void MaxNewBytes(
	TypeSet typeSet,
	long byteCount
)
Visual Basic
Public Sub MaxNewBytes ( _
	typeSet As TypeSet, _
	byteCount As Long _
)
Visual C++
public:
void MaxNewBytes(
	TypeSet^ typeSet, 
	long long byteCount
)

Parameters

typeSet
Type: SciTech.NetMemProfiler..::..TypeSet
A TypeSet containing the types of the instances that should be checked.
byteCount
Type: System..::..Int64
Defines the maximum number of bytes that are allowed to be used by new 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 new instances of the specified types. If more than byteCount bytes are used by new instances, then calling MemAssertion.Assert(MemSnapShot, AssertionsDefinition, AssertionsThread) using this AssertionsDefinition will fail.
Note Note The AllowXXX (AllowInstances(TypeSet), AllowNewInstances(TypeSet)) and MaxXXX (MaxInstances(TypeSet, Int32), MaxNewInstances(TypeSet, Int32), MaxBytes(TypeSet, Int64), MaxNewBytes(TypeSet, Int64)) methods takes precedence over the NoXXX (NoInstances(TypeSet), NoNewInstances(TypeSet)) methods. For more information see AssertionsDefinition.

See Also