Martin Gadbois <[email protected]>:
> Using OpenVPN 2.0.5 and 2.0.9, I notice that an somewhat idle connection
> increases the RSS of the server process linearly with time.
>
> valgrind says that there are no memory leaks. So where is this memory kept?
You might be suffering from the problem I sent a patch for some months
back. Basically, socket.c, socket_connect() accumulated unlimited
amounts of memory if the server wasn't available. I added a pair of
gc_free()/gc_new() in the middle of the loop.
==Begin pseudo-patch====================================================
msg (D_LINK_ERRORS | M_ERRNO_SOCK,
"TCP: connect to %s failed, will try again in %d seconds",
print_sockaddr (remote, &gc),
connect_retry_seconds);
+ /* avoid accumulating garbage when the server is not available */
+ gc_free (&gc);
+ gc = gc_new ();
openvpn_close_socket (*sd);
openvpn_sleep (connect_retry_seconds);
==End pseudo-patch======================================================
It was not garbage because all dynamic memory was kept track of and
would be cleared at the end of the function (gc_free()). However, as
long as a connection couldn't be formed, boundless amounts of memory
were allocated.
Marko