docs: convert vpp doc md->rst
[vpp.git] / src / vpp / mem / mem.rst
1 .. _mempreload_doc:
2
3 VPP mem preload
4 ===============
5
6 Internal VPP memory allocations rely on VPP main-heap, however when
7 using external libraries, esp. in plugins (e.g. OpenSSL library used by
8 the IKEv2 plugin), those external libraries usually manages memory using
9 the standard libc ``malloc()``/``free()``/… calls. This, in turn, makes
10 use of the default libc heap.
11
12 VPP has no knowledge of this heap and tools such as memory traces cannot
13 be used.
14
15 In order to enable the use of standard VPP debugging tools, this library
16 replaces standard libc memory management calls with version using VPP
17 main-heap.
18
19 To use it, you need to use the ``LD_PRELOAD`` mechanism, e.g.
20
21 ::
22
23    ~# LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libvppmem_preload.so /usr/bin/vpp -c /etc/vpp/startup.conf
24
25 You can then use tools such as memory traces as usual.