Question about memory footprint

28 views
Skip to first unread message

linni...@gmail.com

unread,
Apr 15, 2015, 4:17:03 AM4/15/15
to libne...@googlegroups.com
Hi,
I was try to observe the memory usage. I created 1000 objects, I observerd the memory increased. Then I deleted the objects, but the memory was not freed.
After I creating/deleting the 1000 objects for several times, the memory keep unchanged. It looks when the objects was created, the related memory was malloced but never freed.
Could you please explain a bit about it ?

Thank you very much.

Radek Krejčí

unread,
Apr 15, 2015, 4:18:36 AM4/15/15
to linni...@gmail.com, libne...@googlegroups.com
HI,
can you be more specific about "creating objects"? I don't know what you are doing, maybe a code snippet would help.

Regards,
Radek

Dne 15.4.2015 v 03:09 linni...@gmail.com napsal(a):

linni...@gmail.com

unread,
Apr 15, 2015, 10:19:08 PM4/15/15
to libne...@googlegroups.com
Hi Rdek,
Please refer to the tmp test result, I created 20000 interfaces (via ietf-interfaces YANG model), then deleted. After that I created/deleted 10000 interfaces.
 
----------------------------------------------------
Performance test report temp 1.xlsx

Radek Krejčí

unread,
Apr 16, 2015, 5:01:12 AM4/16/15
to linni...@gmail.com, libne...@googlegroups.com
Hi,

I tried to play with it a little bit.

- as I wrote, deleting configuration data does not mean immediate decrease of used memory, since libnetconf stores data backup for rollback (it can be done in a smarter way, now it is stupid, but working). backup is stored (replaces the previous backup data) with each edit-config, copy-config and delete-config.
- changes in memory usage with get-config is a little mystery for me. Actually, when I was trying that, the memory decreased (but I don't see a reason for decrease nor increase of used memory in libnetconf/netopeer). I think, that this is caused by kernel, since free() does not necessary mean that the memory is taken immediately back by kernel. Another reason may be in libxml2 (which actually takes the most memory) and its memory management (if there is any).

So, conclusion, I think that there are only 2 relevenat thinks you should focus on:

1) maximum of used memory (VmPeak), because there was a point when libnetconf/netopeer needed this
2) memory leaks for a long term running - to check this, you should use valgrind

Regards,
Radek


Dne 16.4.2015 v 04:19 linni...@gmail.com napsal(a):
--
You received this message because you are subscribed to the Google Groups "libnetconf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to libnetconf+...@googlegroups.com.
Visit this group at http://groups.google.com/group/libnetconf.
For more options, visit https://groups.google.com/d/optout.

Michal Vasko

unread,
Apr 17, 2015, 9:50:54 AM4/17/15
to libne...@googlegroups.com, linni...@gmail.com
Hi,

there is a simple testing framework available in netopeer-cli ("netopeer/cli/tests/"), which can be used for tests such as yours. Brief explanation of how to write them is included in the README, there is also one example XML, for now.

Regards,
Michal
Reply all
Reply to author
Forward
0 new messages