Open coolMarlon opened 1 year ago
@coolMarlon glibc
has issues with releasing small memory chunks back to the system. So, even if OVS free()
d the memory, it doesn't mean it will actually be returned to the system, unless we explicitly call malloc_trim()
. OVS doesn't trim the memory explicitly today.
You can test that theory by adding malloc_trim()
call to the main loop in ovs-vswitchd
, or by trying a different memory allocator that doesn't have this kind of issues, e.g. jemalloc
(at least older versions of it).
Test:
I am doing some test on OVS, i tried to inject DHCP flapping traffic to generate CLS flows with source IP address and source MAC address changes.
Phenomenon
DHCP flapping traffic triggers “FLOW MISS”,Thus, generate a large number of CLS Flow(30K+)![image](https://github.com/openvswitch/ovs-issues/assets/23504706/8b9d4d01-64d5-455b-9fb3-c9fcdc924cca)
I found when I inject traffic, the memory of ovs-vswitchd will increased from 150MB to 330MB. When i stop injecting traffic, the memory decreases to 210 MB, not 150MB(initial value).
Quesiton
I'm not sure if this is a memory leak. The OVS I use has some modifications of its own. I want to test opensource OVS whether have same problem, but it is difficult to consturct such environmet. I used valgrind to start ovs, but i can not find memory leak in log.
It is diffuicult to analyize why after injecting traffic, the memory is not restored to the initial value? Do you have some advice? thanks.