|
From: Martin <md...@md...> - 2003-01-06 17:54:04
|
m=E5n 2003-01-06 klockan 17.31 skrev Zoltan Felleg:
> hello list,
>=20
> i have a problem with pyOpenSSL, as follows:
> if i create a network client, i must explicitly delete the context of it=20
> and the client itself to free the memory it is using. ie. a class with=20
> the ctx =3D SSL.Context, conn =3D SSL.Connection attributes is not remove=
d=20
> from memory, if i do not delete the conn.ctx and the conn attributes. i=20
> was testing it with a simple loop that just created a thousand=20
> connection objects without connecting them to anywhere, and it used up=20
> about 20 megabytes of memory. besides that, there is another problem i=20
Would you mind detailing the exact test script you used? With the
following script
=3D=3D=3D
from OpenSSL import SSL
import socket
while 1:
ctx =3D SSL.Context(SSL.TLSv1_METHOD)
conn =3D SSL.Connection(ctx, socket.socket())
=3D=3D=3D
running on Debian unstable, using OpenSSL 0.9.6g, pyOpenSSL 0.5.1 and
Python 2.2.2 I can't detect any leaking at all (monitoring it in top
while it's running)
Am I misunderstanding you?
> could not work around, which arises at the server side of an SSL=20
> connection. using the simple server in the examples directory of the=20
> package, a thousand clients connecting, sending some data and then=20
> disconnecting also made the server to use significantly more memory than=20
> the amount it was using at the startup. is it a problem with me doing=20
> something evil, or is it a problem in pyOpenSSL or even in OpenSSL? in=20
> the first case what the heck am i doing wrong? the environment is Red=20
> Hat linux 8.0, OpenSSL 0.9.6h, pyOpenSSL 0.5.1, Python 2.2.2.
I tried running
python server.py 2000 >& /dev/null
and
while true; do echo foo | python client.py localhost 2000; done >&
/dev/null
and the memory usage of the server did increase, but very very very
slowly, it took several *minutes* for it to reach 5% of my total memory
(256M), and then I sat watching it for several more minutes and it never
went over 6.1%. I don't know what to make of it. :)
/Martin
|