pyamf, 0.6.1, memory leaks

173 Views Asked by At

Following increasing memory usage by the server using PyAMF, after several hours of digging, I noticed that the reason is the pyamf library in version 0.6.1 installed by easy_install. This error occurred on Ubuntu 12.04 on both: 64 bit and 32 bit versions. Below is a report from the valgrind massif tool.

--------------------------------------------------------------------------------
Command:            python build_web/web2py.py -a root --minthreads=1 --maxthreads=1 --nogui
Massif arguments:   --depth=50
ms_print arguments: massif.out.492
--------------------------------------------------------------------------------

    MB
31.69^                                                                       #
 |                                                                  @@::@#
 |                                                     @@    :@:::::@ : @#
 |                                                ::: :@ :::::@: :: @ : @#
 |                                       :   ::::::: ::@ : : :@: :: @ : @#
 |                                       ::::::: ::: ::@ : : :@: :: @ : @#
 |                                       ::: ::: ::: ::@ : : :@: :: @ : @#
 |                           ::::@::@::::::: ::: ::: ::@ : : :@: :: @ : @#
 |                     ::::::: : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 |                 :@@::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 |      ::::::::::::@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 |      :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | ::::::: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
 | :: : :: ::: ::: :@ ::: :: : : @: @::: ::: ::: ::: ::@ : : :@: :: @ : @#
0+----------------------------------------------------------------------->Ti
 0                                                                   2.678

The solution, working on my case, is to use cpyamf or install the pyamf package using pip pip install pyamf, because this command install cpyamf as well and the __init.py__ contains the conditional import i.e.

try:
    from cpyamf import amf3
except ImportError:
    from pyamf import amf3

Could You give me explanation what is happen?

0

There are 0 best solutions below