Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin3!goblin2!goblin.stu.neva.ru!feeder1.cambriumusenet.nl!feed.tweaknews.nl!194.109.133.85.MISMATCH!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.011 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; '(at': 0.03; 'lines,': 0.05; 'memory.': 0.05; 'reason,': 0.07; 'python': 0.09; 'pointers': 0.09; 'runtime': 0.09; 'cc:addr:python-list': 0.10; 'file,': 0.15; 'value.': 0.15; 'blocks': 0.16; 'build.': 0.16; 'heap,': 0.16; 'limit,': 0.16; 'md5': 0.16; 'next.': 0.16; 'storing': 0.16; 'subject:usage': 0.16; 'surprising': 0.16; 'wrote:': 0.17; 'bytes': 0.17; 'memory': 0.18; 'windows': 0.19; 'file.': 0.20; 'written': 0.20; 'bit': 0.21; 'sorry,': 0.22; 'cc:2**0': 0.23; 'cc:no real name:2**0': 0.24; 'idea': 0.24; 'linux': 0.24; 'machine': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'realize': 0.27; 'wonder': 0.27; 'object,': 0.27; 'structures': 0.27; "doesn't": 0.28; 'there.': 0.28; 'measure': 0.29; 'subject:per': 0.29; 'surprised': 0.29; "i'm": 0.29; 'normally': 0.30; 'code': 0.31; 'point': 0.31; 'gets': 0.32; 'file': 0.32; "aren't": 0.33; 'values.': 0.33; 'another': 0.33; 'that,': 0.34; 'loss': 0.34; 'problem,': 0.35; 'something': 0.35; 'ability': 0.36; 'but': 0.36; 'loaded': 0.36; 'anything': 0.36; 'should': 0.36; 'beyond': 0.37; 'reported': 0.37; 'two': 0.37; 'virtual': 0.37; 'quite': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'store': 0.38; 'mean': 0.38; 'object': 0.38; 'some': 0.38; 'sure': 0.38; 'several': 0.39; 'system.': 0.39; 'received:192': 0.39; 'space': 0.39; 'received:192.168': 0.40; 'help': 0.40; 'think': 0.40; 'your': 0.60; 'most': 0.61; 'save': 0.61; 'map': 0.61; 'free': 0.61; 'back': 0.62; 'times': 0.63; 'more': 0.63; 'account': 0.67; 'header:Reply-To:1': 0.68; 'received:74.208': 0.71; 'million': 0.72; 'reply-to:no real name:2**0': 0.72; 'confusing': 0.84; 'destruction,': 0.84; 'hanging': 0.84; "it'd": 0.84; 'manages': 0.84; 'overhead,': 0.84; "shouldn't,": 0.84; 'preventing': 0.91 Date: Tue, 25 Sep 2012 07:06:29 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0 MIME-Version: 1.0 To: Junkshops Subject: Re: Memory usage per top 10x usage per heapy References: <983c532f-3ff6-4bd2-bb48-07cf4d065a4b@googlegroups.com> <5061056F.6080702@davea.name> <50613131.6030102@gmail.com> In-Reply-To: <50613131.6030102@gmail.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:/j6gKYnEEs5SVQJNZWudXXVsBBcS6rdzanEh0TLJAr2 iT7UQMh0hWsvmYjK7XfUJ2e4JylGuezrhn+X72M8oPkDLEhJAy Q4qNm10VXcE6FeZFdPu/Y5vI+CIc8V/IAFwhXOzcoMbKJz/jBD k5dPOrhIcQMr+fhXbUPbtOaxvHaXuIcEywbPlcuqtfqZz4mYSZ yW2lPOdFHVz6qm9Xmmu06PL00/V381Xbi24a7uPTC4yAg/Io63 PeWeUYbG7JgDHnMrKVFa/bxJnExatsVvWUiSzJpB/zUXZ+OfL9 TjLaDGa3ZbrOcLMZF4bYDk7yKgcPLje4O11FFc2kuX2wlG/oA= = Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: d@davea.name 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: 43 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1348571218 news.xs4all.nl 6877 [2001:888:2000:d::a6]:56331 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30065 On 09/25/2012 12:21 AM, Junkshops wrote: >> Just curious; which is it, two million lines, or half a million bytes? > > Sorry, that should've been a 500Mb, 2M line file. > >> which machine is 2gb, the Windows machine, or the VM? > VM. Winders is 4gb. > >> ...but I would point out that just because >> you free up the memory from the Python doesn't mean it gets released >> back to the system. The C runtime manages its own heap, and is pretty >> persistent about hanging onto memory once obtained. It's not normally a >> problem, since most small blocks are reused. But it can get >> fragmented. And i have no idea how well Virtual Box maps the Linux >> memory map into the Windows one. > Right, I understand that - but what's confusing me is that, given the > memory use is (I assume) monotonically increasing, the code should never > use more than what's reported by heapy once all the data is loaded into > memory, given that memory released by the code to the Python runtime is > reused. To the best of my ability to tell I'm not storing anything I > shouldn't, so the only thing I can think of is that all the object > creation and destruction, for some reason, it preventing reuse of > memory. I'm at a bit of a loss regarding what to try next. I'm not familiar with heapy, but perhaps it's missing something there. I'm a bit surprised you aren't beyond the 2gb limit, just with the structures you describe for the file. You do realize that each object has quite a few bytes of overhead, so it's not surprising to use several times the size of a file, to store the file in an organized way. I also wonder if heapy has been written to take into account the larger size of pointers in a 64bit build. Perhaps one way to save space would be to use a long to store those md5 values. You'd have to measure it, but I suspect it'd help (at the cost of lots of extra hexlify-type calls). Another thing is to make sure that the md5 object used in your two maps is the same object, and not just one with the same value. -- DaveA