← Back to team overview

openstack team mailing list archive

Re: Memory leaks from greenthreads

 

On Wed, Feb 29, 2012, Vishvananda Ishaya <vishvananda@xxxxxxxxx> wrote:
> We have had a memory leak due to an interaction with eventlet for a
> while that Johannes has just made a fix for.
> 
> bug:
> https://bugs.launchpad.net/nova/+bug/903199
> 
> fix:
> https://bitbucket.org/which_linden/eventlet/pull-request/10/monkey-patch-threadingcurrent_thread-as
> 
> Unfortuantely, I don' t think we have a decent workaround for nova
> while that patch is upstreamed.  I wanted to make sure that all of
> the distros are aware of it in case they want to carry an eventlet
> patch to prevent the slow memory leak.

There is one other possible workaround, but I didn't feel like it was
safe since we would likely need to audit all of the third party libraries
to ensure they don't cause problems.

The memory leak only happens when monkey patching the
thread/threading/Queue modules. I looked at the nova sources and did
some tests and it doesn't appear nova needs those modules patches.

However, third party modules might need it. Also, I only tested on
xenapi. libvirt and/or vmwareapi might have problems. Or possibly other
drivers (firewall, volume, etc) in nova that I didn't use in my tests.

If you're having problems with the memory leak in eventlet and applying
the patch isn't an option, then monkey patching everything but thread
might something worth trying.

eventlet.monkey_patch(os=True, socket=True, time=True)

JE



Follow ups

References