Configure dotMemory Unit
The default dotMemory Unit configuration allows using it “out of the box”. Nevertheless, in some cases you may want to redefine particular options like workspace files location or total size limit for auto-saved workspaces. This is done with the help of DotMemoryUnitAttribute
placed before an assembly, a test class, or a test method.
Example
DotMemoryUnitAttribute
DotMemoryUnitAttribute properties
Name | Type | Description |
---|---|---|
|
| Defines whether the memory allocation data (memory traffic and creation stack trace data) must be collected. By default, Note that the AssertTraffic attribute enables collecting allocations in the marked method automatically. You do not need to add the |
|
| Path to the directory where workspace files must be saved. This can be either a full path or a path relative to the assembly where the test method is declared. Note that for simplicity, you can use a number of placeholders for special directories:
|
|
| Maximum disk size in bytes that can be used for storing workspaces. The default value is 200 MB. Before saving a workspace, dotMemory Unit checks the total size of all previously saved workspaces in the session. If the limit is not yet exceeded, the workspace will be saved (even if this will exceed the limit). |
|
| If If The default value is |
|
| Defines conditions for auto-saving workspaces:
|
|
| Maximum number of workspaces that can be saved upon test failures. The default value is 5. |