Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.007 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'none,': 0.05; 'url:blog': 0.09; 'python': 0.09; 'idea?': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'sub': 0.09; 'subject:()': 0.09; "'0',": 0.16; '(3,': 0.16; '49,': 0.16; 'corrupt': 0.16; 'none),': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:w 70': 0.16; 'wrote:': 0.17; 'previously': 0.18; 'are:': 0.20; "skip:' 40": 0.22; 'references': 0.23; 'non': 0.24; 'script': 0.24; 'header:User-Agent:1': 0.26; 'object,': 0.27; 'header:X-Complaints-To:1': 0.28; 'skip:( 20': 0.28; '>>>>': 0.29; 'source': 0.29; 'class': 0.29; "skip:' 10": 0.30; 'code': 0.31; "skip:' 20": 0.32; 'extract': 0.33; 'to:addr:python-list': 0.33; 'received:org': 0.36; 'charset:us-ascii': 0.36; 'subject:: ': 0.38; 'object': 0.38; 'delete': 0.38; 'gives': 0.39; 'to:addr:python.org': 0.39; 'application': 0.40; 'header:Received:5': 0.40; 'skip:w 30': 0.61; 'back': 0.62; 'situation': 0.62; 'helps': 0.63; 'received:ac.uk': 0.65; 'hunt': 0.84; 'leak.': 0.84; 'object:': 0.84; 'oscar': 0.84; 'ref': 0.84; 'subject:skip:g 10': 0.84; 'graphical': 0.91; 'urgently': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Oscar Benjamin Subject: Re: gc.get_objects() Date: Mon, 17 Sep 2012 17:43:06 +0000 (UTC) References: <52847c35-388c-4758-b72d-1d1859b788a3@googlegroups.com> <8370412f-5176-45ff-87eb-72cbca5149d5@googlegroups.com> <5055a1a6$0$29981$c3e8da3$5496439d@news.astraweb.com> <4f9d9a0b-539a-4b6a-af3e-b02d1f4006ee@googlegroups.com> <505730ad$0$29981$c3e8da3$5496439d@news.astraweb.com> <50575C8B.3000309@boscolini.eu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: enm-ob.enm.bris.ac.uk User-Agent: slrn/0.9.9p1/mm/ao (Win32) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 65 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347903801 news.xs4all.nl 6873 [2001:888:2000:d::a6]:46731 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29384 On 2012-09-17, Matteo Boscolo wrote: > from my gc.get_object() > I extract the sub system of the object that I would like to delete: > > this is the object: > Class name > win32com.gen_py.F4503A16-F637-11D2-BD55-00500400405Bx0x1x0.ITDProperty.ITDProperty > that is traked and the reference are: > get_referents >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> > >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> > >>>>>>>>>>>> > RefCount 5 > >>>> ( 0x026ACB58>,) > RefCount 5 > >>>> '__int__': , > '__module__': 'win32com.gen_py.F45 > RefCount 8 > >>>> ITDProperty > RefCount 9 > >>>> > RefCount 9 > >>>> > get_referrers >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> > >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> > >>>>>>>>>>>> > RefCount 15 > >>>> 'python_version': 34014192, 'defaultUnnamedArg': > RefCount 6 > >>>> win32com.gen_py.F4503A16-F637-11D2-BD55-00500400405Bx0x1x0.ITDProperty.I > RefCount 4 > >>>> (u'ItemsListCreator', u'trick', u'pVal'), (3, 49, > '0', None), (16393, 10, None, > RefCount 4 > >>>> > RefCount 7 > >>>> > RefCount 5 > >>>> '{39AAEA35-F71F-11D2-BD59-00500400405B}': win32com.gen_py.F4503A16-F637- > > how can I understand how to clean up this situation or were are the > references that I need to delete ? > > From the cad non python script I call an in process python com object, > and before coming back to the cad application I need to clean up all com > reference, because if I do not do that I corrupt the cad application . > > so I urgently need to clean up all reference before coming back to the > cad application. > > any idea? > http://mg.pov.lt/objgraph/ http://mg.pov.lt/blog/hunting-python-memleaks.html I have previously used the code from one of the links above to hunt down a reference leak. It gives a graphical view of the alive references which helps to locate the source of the ref leak. Oscar