Purpose

The module MemoryView is a debugging tool to record and analyze memory usage of the current process. If it is activated it logs all memory allocations and frees and the amount of allocated and freed memory. It also checks whether safety margins around allocated memory blocks are affected, i.e. whether algorithms exceed valid memory borders.

Important Notes

  • Note that all memory allocations of the entire process are logged - this includes string operations as well as data structure resizes, window operations, scripting operations and many more. Even simple button presses or mouse movements to (de)activate the memory recording already cause memory operations. Therefore memory logging will nearly always detect asymmetric numbers of allocation/frees and memory sizes. It is up to the user to identify whether these differences are significant or not. See the fields Maximum Allocation Difference, Maximum Memory Difference, and Min Chunk Size To Log to reduce these effects.
  • This module is only functional in debug mode on Windows systems. All other systems are not supported.

Windows

Default Panel

../../../Modules/ML/MLDiagnosis/mhelp/Images/Screenshots/MemoryTracer._default.png

Parameter Fields

Visible Fields

Start/Stop Logging

name: startStopLogging, type: Trigger

Starts/stops memory counting.

Start/Stop Sleeping

name: startStopSleeping, type: Trigger

Makes memory logging sleep/awake.

Logging Is Active

name: loggingIsActive, type: Bool, persistent: no

Shows whether logging is active.

Is Sleeping

name: isSleeping, type: Bool, persistent: no

Shows whether logging is temporarily suspended.

Clear Cache Before After Logging

name: clearCacheBeforeAfterLogging, type: Bool, default: TRUE

If enabled, for each (re)allocation, free and error a table entry is created for a detailed report.

If disabled, only a summary is created. Take care, because recording full information might be time and memory consuming.

Record Full Information

name: recordFullInformation, type: Bool, default: FALSE

Do not use!

Still deactivated and still unstable experimental functionality.

It adds more information about (potential) memory leaks in reports. It is more significantly more memory and time consuming than normal memory tracing.

Record Stack Walks

name: recordStackWalks, type: Bool, default: FALSE

Do not use!

Still deactivated and still unstable experimental functionality.

It adds full stack trace information to (potential) memory leaks in reports. It is significantly more memory and time consuming than normal memory tracing.

Post Error On Differences

name: postErrorOnDifferences, type: Bool, default: FALSE

If enabled, an error is posted to the ML error handled if any memory or allocation difference is exceeded.

Maximum Allocation Difference

name: maximumAllocationDifference, type: Integer, default: 0

Sets the maxmimum allowed limit between allocations and deallocations between logging start and stop.

Maximum Memory Difference

name: maximumMemoryDifference, type: Integer, default: 0

Sets the maxmimum allowed limit between allocated bytes between logging start and stop.

Maximum Report Size

name: maximumReportSize, type: Integer, default: 25000

Sets the maximum allowed size of the generated full report in characters.

Min Chunk Size To Log

name: minChunkSizeToLog, type: Integer, default: 0

Sets the minimum size a memory chunk must have to be logged.

Useful to suppress logging of small memory (de)allocations.

Status

name: status, type: String, persistent: no

Shows general module information and results.

Hidden Fields

enableAll

name: enableAll, type: Bool, persistent: no