Hi, On Fri, Nov 01, 2013 at 06:40:32PM +0800, Brad Zhang wrote: > You are right, it may be memory fragmentation, because I tested the openvpn > 2.1_rc4, the memory was also increased.
OK, so 2.3.2+patch+openssl is no worse than 2.1_rc4, which means I found
what we broke in 2.2 - good.
Now, OpenVPN does a lot of small memory allocations and frees, and I think
this pretty much inevitably leads to some fragmentation. This *should*
get cleaned up to a large extent when your clients disconnect, as OpenVPN
will then free everything allocated to the particular client.
OTOH:
> The result is :
> openvpn 2.1_rc4 200 clients:
> 2013/10/30 4:39 138372 2013/10/30 4:49 264164 2013/10/30 4:59
> 266540 2013/10/30
> 5:09 269180 2013/10/30 5:19 269444 2013/10/30 5:29 269444 2013/10/30 5:39
> 269444 2013/10/30 5:50 269444 2013/10/30 6:00 269708 2013/10/30 6:10
[..]
> 271556 2013/10/31 9:27 271556 2013/10/31 9:37 271556
... the growth in used memory is not fast, and I assume that it will
eventually slow down to a "steady state", at least if a few clients
reconnect here and there.
> I also have a question, is there a way to avoid the memory fragmentation?
> The memory fragmentation will take a lot of memory if openvpn run long
> time with a lot of connections.
I'm not sure. One would need to study memory usage much more closely
an see why it still increases after a day. The code does a lot of things,
and I'm just guessing that it's fragmentation (it's definitely not a
"classic" memory leak, as valgrind would have found that)
gert
--
USENET is *not* the non-clickable part of WWW!
//www.muc.de/~gert/
Gert Doering - Munich, Germany [email protected]
fax: +49-89-35655025 [email protected]
pgpshQ3JALFHs.pgp
Description: PGP signature
