aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp/mem/mem.rst
blob: 82ae2ff35dfad08a07b75fa1636f212f4be41e14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
.. _mempreload_doc:

VPP mem preload
===============

Internal VPP memory allocations rely on VPP main-heap, however when
using external libraries, esp. in plugins (e.g. OpenSSL library used by
the IKEv2 plugin), those external libraries usually manages memory using
the standard libc ``malloc()``/``free()``/… calls. This, in turn, makes
use of the default libc heap.

VPP has no knowledge of this heap and tools such as memory traces cannot
be used.

In order to enable the use of standard VPP debugging tools, this library
replaces standard libc memory management calls with version using VPP
main-heap.

To use it, you need to use the ``LD_PRELOAD`` mechanism, e.g.

::

   ~# LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libvppmem_preload.so /usr/bin/vpp -c /etc/vpp/startup.conf

You can then use tools such as memory traces as usual.