[ https://issues.apache.org/jira/browse/ZOOKEEPER-792?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12900380#action_12900380 ]
Henry Robinson commented on ZOOKEEPER-792: ------------------------------------------ Aha - I think I have found the problem, and it was related to this patch. PyObject *ret = Py_BuildValue( "(s#,N)", buffer,buffer_len, stat_dict ); + free_pywatcher(pw); free(buffer); We shouldn't free the pywatcher_t object here because it may be called later. This was what was causing the segfault I was seeing. I'll upload a new patch with this line removed; I hope it will still fix your memory consumption issues. > zkpython memory leak > -------------------- > > Key: ZOOKEEPER-792 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-792 > Project: Zookeeper > Issue Type: Bug > Components: contrib-bindings > Affects Versions: 3.3.1 > Environment: vmware workstation - guest OS:Linux python:2.4.3 > Reporter: Lei Zhang > Assignee: Lei Zhang > Fix For: 3.3.2, 3.4.0 > > Attachments: ZOOKEEPER-792.patch > > > We recently upgraded zookeeper from 3.2.1 to 3.3.1, now we are seeing less > client deadlock on session expiration, which is a definite plus! > Unfortunately we are seeing memory leak that requires our zk clients to be > restarted every half-day. Valgrind result: > ==8804== 25 (12 direct, 13 indirect) bytes in 1 blocks are definitely lost in > loss record 255 of 670 > ==8804== at 0x4021C42: calloc (vg_replace_malloc.c:418) > ==8804== by 0x5047B42: parse_acls (zookeeper.c:369) > ==8804== by 0x5047EF6: pyzoo_create (zookeeper.c:1009) > ==8804== by 0x40786CC: PyCFunction_Call (in /usr/lib/libpython2.4.so.1.0) > ==8804== by 0x40B31DC: PyEval_EvalFrame (in /usr/lib/libpython2.4.so.1.0) > ==8804== by 0x40B4485: PyEval_EvalCodeEx (in /usr/lib/libpython2.4.so.1.0) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.