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 information may be written to the DLT log file or processed in near real time by TempoGiusto.

DLT Log File
The information can be viewed within the DLT Viewer.

TempoGiusto
The information can be graphically represented in TempoGiusto.

How to Get Memory Usage Information
This section outlines important settings which may vary between target platforms.

Platform Independent Settings
These 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 = 

period is update period in ms to take the memory usage snapshots, default 10000 ms

Platform Specific Settings
The functionality has been tested on Windows and Linux platform.

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