Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.095 X-Spam-Evidence: '*H*': 0.82; '*S*': 0.01; 'url:pypi': 0.03; 'operator': 0.03; 'output': 0.04; 'subject:Python': 0.05; 'filename': 0.07; 'python': 0.09; 'compute': 0.09; 'url:github': 0.09; 'file,': 0.15; 'independent,': 0.16; 'optionally': 0.16; 'other:': 0.16; 'to:name:python list': 0.16; 'memory': 0.18; 'delta': 0.22; 'names.': 0.22; 'example': 0.23; 'patch': 0.24; 'total:': 0.27; 'message-id:@mail.gmail.com': 0.27; 'source': 0.29; 'install': 0.29; 'url:python': 0.32; 'file': 0.32; '2006': 0.33; 'allocated': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'version': 0.34; 'received:google.com': 0.34; 'skip:. 20': 0.35; 'created': 0.36; 'tool': 0.36; 'url:org': 0.36; 'announce': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'release': 0.39; 'skip:" 10': 0.40; 'your': 0.60; 'most': 0.61; 'between': 0.63; 'helps': 0.63; 'show': 0.63; 'total': 0.65; 'includes:': 0.65; 'media': 0.66; 'targeted': 0.66; 'consumer': 0.67; 'products': 0.70; 'power': 0.74; 'information:': 0.74; 'products.': 0.74; 'brand': 0.78; '#1:': 0.84; '#2:': 0.84; 'devices,': 0.84; 'more:': 0.84; 'recompile': 0.84; 'subject:tool': 0.84; 'victor': 0.84; 'boxes,': 0.91; 'average': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type:content-transfer-encoding; bh=LX+mwDdCRscVEo8ZZHm96saCf/TkuQvmxTVSWJxHH5o=; b=0v8MdeIT0YNu0kOV5pGbA7aZtuc0j6AstiLsrRnxzvjAWPrxzYpjSzJvA3GGj/wo++ rqfzY5lwFutHQjapaPMWsdCpzyVTeLRO9O0mEMMm59KGXeG9P/hmVSu66vconI0D4S6y OXtvgKR5+SFrAQAI6vVYML0uYaRPybzWuiemi1ZyDKEfENabIjigE0nkNJ8/DWND8tNz 33g5xN9v3cPggkLgqlsc35Q6K+i1t8ihcDG0oHjdBHkO4wOo9swt5Fi4DKa7Ssl51Ddu rcx0QSt4H+aLNXzjARerUexzWQfBOjSd+uH/Pro1il8g1BxCTBn4ckq50oTP0Vnar+xa I+nA== X-Received: by 10.112.82.164 with SMTP id j4mr103756lby.112.1362691774404; Thu, 07 Mar 2013 13:29:34 -0800 (PST) MIME-Version: 1.0 From: Victor Stinner Date: Thu, 7 Mar 2013 22:29:14 +0100 Subject: pytracemalloc 0.7: new tool to track memory leaks in Python To: Python List Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: 72 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362692142 news.xs4all.nl 6876 [2001:888:2000:d::a6]:33319 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40828 Hi, Wyplay is proud to announce the release of a new tool to track Python memory allocations: "pytracemalloc". https://pypi.python.org/pypi/pytracemalloc https://github.com/wyplay/pytracemalloc pytracemalloc provides the following information: - Allocated size and number of allocations per file, or optionally per file and line number - Compute the average size of memory allocations - Compute delta between two "snapshots" - Get the source of a memory allocation: filename and line number It helps to track memory leaks: show directly in which Python files the memory increases. Example of pytracemalloc output (compact): 2013-02-28 23:40:18: Top 5 allocations per file #1: .../Lib/test/regrtest.py: 3998 KB #2: .../Lib/unittest/case.py: 2343 KB #3: .../ctypes/test/__init__.py: 513 KB #4: .../Lib/encodings/__init__.py: 525 KB #5: .../Lib/compiler/transformer.py: 438 KB other: 32119 KB Total allocated size: 39939 KB Example of pytracemalloc output (full): 2013-03-04 01:01:55: Top 10 allocations per file and line #1: .../2.7/Lib/linecache.py:128: size=3D408 KiB (+408 KiB), count=3D5379 (+5379), average=3D77 B #2: .../unittest/test/__init__.py:14: size=3D401 KiB (+401 KiB), count=3D6668 (+6668), average=3D61 B #3: .../2.7/Lib/doctest.py:506: size=3D319 KiB (+319 KiB), count=3D197 (+197), average=3D1 KiB #4: .../Lib/test/regrtest.py:918: size=3D429 KiB (+301 KiB), count=3D5806 (+3633), average=3D75 B #5: .../Lib/unittest/case.py:332: size=3D162 KiB (+136 KiB), count=3D452 (+380), average=3D367 B #6: .../Lib/test/test_doctest.py:8: size=3D105 KiB (+105 KiB), count=3D1125 (+1125), average=3D96 B #7: .../Lib/unittest/main.py:163: size=3D77 KiB (+77 KiB), count=3D1149 (+1149), average=3D69 B #8: .../Lib/test/test_types.py:7: size=3D75 KiB (+75 KiB), count=3D1644 (+1644), average=3D46 B #9: .../2.7/Lib/doctest.py:99: size=3D64 KiB (+64 KiB), count=3D1000 (+1000), average=3D66 B #10: .../Lib/test/test_exceptions.py:6: size=3D56 KiB (+56 KiB), count=3D932 (+932), average=3D61 B 3023 more: size=3D1580 KiB (+1138 KiB), count=3D12635 (+7801), average= =3D128 B Total: size=3D3682 KiB (+3086 KiB), count=3D36987 (+29908), average=3D1= 01 B To install pytracemalloc, you need to patch and recompile your own version of Python to be able to hook all Python memory allocations. -- Wyplay was created in March 2006 in the south of France. Independent, Europe-based, and internationally recognized, Wyplay=E2=80=99s TV-centric software solutions power the world=E2=80=99s most popular operator and consumer electronic brand names. Targeted products includes: Connected-HDTVs, Media Center CE devices, HD IPTV boxes, DVB-S/C/T HD STBs, and in-home media-HDD products. http://www.wyplay.com/ Victor