You are right, The clib_mem_init call mmap to allocate virtual memory, but
I got random SIGSEGV for the client program When the running machine has
low memory ( about 2G ). So I changed client.c and memory_client.c to
allocate lower virtual memory and only when I call connect_to_vlib.


The changes are uploaded in this link
<https://paste.ubuntu.com/p/9NYDD5Hm4g/>.


Please show me a sample of using Unix socket to call vpp api.

Another thing, when I enabled memory overcommit 'echo 1 >
/proc/sys/vm/overcommit_memory
' , SIGSEGV is not happened. but it's too risky and I don`t like it.

look at the following line of `ps aux` output:
root     22237  100  0.1 124111660 68004 ?     Rsl  17:24  16:44
/usr/bin/vpp -c /etc/vpp/startup.conf
vpp has 124GB Virtual memory!! Is there a memory leak?

Regards,
Emma

On Mon, Dec 2, 2019 at 12:01 PM Ole Troan <[email protected]> wrote:

> Emma,
>
> > The function vac_client_constructor allocates 1 GB of memory in every
> binary which linked to the vlibmemoryclient library.
> > I have limited memory in my test machine. Is there any way to resolve
> this issue?
>
> Firstly this is virtual memory.
>
> If I recall correctly the API client uses the heap largely for the message
> dictionary.
> You can certainly make this tunable / make a better estimate of how much
> memory it needs.
> Or you can use the Unix Domain socket transport. That doesn't require a
> VPP memory heap on the client side at all.
>
> Cheers,
> Ole
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14751): https://lists.fd.io/g/vpp-dev/message/14751
Mute This Topic: https://lists.fd.io/mt/64406844/21656
Group Owner: [email protected]
Unsubscribe: https://lists.fd.io/g/vpp-dev/unsub  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to