Project:VisualEditor testing/Test

Memory Usage Information

Ideas and Methods
We need information about the used memory (virtual and physical memory).

Virtual Memory
We analyze process's dynamic memory. It was done by intercepting the calls to malloc and free. However this information says nothing about how much of the virtual memory is being used by memory mapping.

Physical Memory
Physical memory consumption by tracking the resident set size is a little better. Unfortunately RSS doesn't distinguish between memory that is shared and memory that is not.

How to Display Memory Usage Information
The memory usage information may be written to the DLT log file or processed in near real time by TempoGiusto.

How to Get Memory Usage Information
The following parameter must be set in the navigation.ini configuration file:

[DLT]

Context += na::main_::helperlib::AllocatorCollection 0x04ff

Context += na::base::mem::MemMon 0x04ff

[memory]

monitor = true

period = 

Platform Specific Settings
This section outlines important settings which may vary between target platforms.

Windows
A callback is used, which is available in the debug build.

Linux
A special library libMemTrackerHookLib.so is created during the build process. This library hooks into the standard libc heap functions to keep records about currently allocated memory.

Use this here to define that the libary should be loaded before any other shared libraries, so the executable is linked first against it:

export LD_PRELOAD=/[libpath]/libMemTrackerHookLib.so