Menu

#714 Memory leak in PyTango for direct server command calls

closed-fixed
nobody
None
PyTango
5
2015-04-28
2015-04-09
No

Hi,

I've just noticed a memory leak in PyTango. It appears when I try to call server commands directly, i.e.

import PyTango
import gc

for i in range(10000):
    print i
    dp = PyTango.DeviceProxy("sys/tg_test/1")
    dp.SwitchStates()
    gc.collect()

gives me about 200MB large memory usage then

import PyTango
import gc

for i in range(10000):
    print i
    dp = PyTango.DeviceProxy("sys/tg_test/1")
    dp.command_inout("SwitchStates")
    gc.collect()

In the first case the used memory grows with i.

I'm using debian wheezy with

python-pytango 8.1.1-1~bpo70+1
tango-common 8.1.2c+dfsg-4~bpo70+1
libtango8:amd64 8.1.2c+dfsg-4~bpo70+1

...

It happens also for other commands and other tango servers.

Best regards,
Jan

Discussion

  • Frédéric PICCA

    jessie (8.1.5-1)
    and
    experimental (8.1.6-1~exp1)

    are also affected

    Fred

     
  • Tiago Coutinho

    Tiago Coutinho - 2015-04-13

    I confirm the bug exists since PyTango 7.2

    There is a cyclic reference between DeviceProxy object and method corresponding to a command.

    Will be fixed in next PyTango 8.1.7. Thanks for reporting

     
  • Tiago Coutinho

    Tiago Coutinho - 2015-04-28
    • status: open --> closed-fixed
     

Log in to post a comment.