Re: [Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-09-01 Thread Ian Campbell
On Mon, 2015-08-31 at 13:04 +0100, Wei Liu wrote: > On Fri, Aug 28, 2015 at 05:35:18PM -0400, Zhigang Wang wrote: > > Python PyList_Append() will increase reference count of the item. We > > have to > > decrease its reference count to let it garbage collected. > > > > We missed the Py_DECREF() fo

Re: [Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-09-01 Thread Ian Campbell
On Mon, 2015-08-31 at 13:32 +0100, Wei Liu wrote: > On Mon, Aug 31, 2015 at 01:27:35PM +0100, Andrew Cooper wrote: > > On 31/08/2015 13:04, Wei Liu wrote: > > > On Fri, Aug 28, 2015 at 05:35:18PM -0400, Zhigang Wang wrote: > > > > Python PyList_Append() will increase reference count of the item. >

Re: [Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-08-31 Thread Wei Liu
On Mon, Aug 31, 2015 at 01:27:35PM +0100, Andrew Cooper wrote: > On 31/08/2015 13:04, Wei Liu wrote: > > On Fri, Aug 28, 2015 at 05:35:18PM -0400, Zhigang Wang wrote: > >> Python PyList_Append() will increase reference count of the item. We have > >> to > >> decrease its reference count to let it

Re: [Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-08-31 Thread Andrew Cooper
On 31/08/2015 13:04, Wei Liu wrote: > On Fri, Aug 28, 2015 at 05:35:18PM -0400, Zhigang Wang wrote: >> Python PyList_Append() will increase reference count of the item. We have to >> decrease its reference count to let it garbage collected. >> >> We missed the Py_DECREF() for 'cpuinfo_obj' here, th

Re: [Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-08-31 Thread Wei Liu
On Fri, Aug 28, 2015 at 05:35:18PM -0400, Zhigang Wang wrote: > Python PyList_Append() will increase reference count of the item. We have to > decrease its reference count to let it garbage collected. > > We missed the Py_DECREF() for 'cpuinfo_obj' here, thus we have a memory leak. > > The memory

[Xen-devel] [PATCH] python/xc: add missing Py_DECREF() to fix a memory leak

2015-08-28 Thread Zhigang Wang
Python PyList_Append() will increase reference count of the item. We have to decrease its reference count to let it garbage collected. We missed the Py_DECREF() for 'cpuinfo_obj' here, thus we have a memory leak. The memory leak could be easily confirmed by: # python >>> import xen.lowlevel.