Re: git-svnimport failed and now git-repack hates me
- From
Randal L. Schwartz <merlyn@stonehenge.com>
- Date
- Jan 4, 2007, 02:40 UTC
- Message-ID
- <86ps9vbjlp.fsf@blue.stonehenge.com>
- In-Reply-To
- <20070104023350.GA1194@localdomain>
>>>>> "Eric" == Eric Wong <normalperson@yhbt.net> writes:
Eric> Part of it is Perl, which (as far as I know) never frees allocated Eric> memory back to the OS (although Perl can reuse the allocated memory for Eric> other things).
It does on Linux, of all things. That's because Linux has a smarter malloc/free that uses mmap(2) for the large chunks. On Linux, Perl memory size can apparently grow and shrink nicely. The "old school" advice about Perl comes from sbrk(2)-driven malloc/free.
Try:
$x[1e6] = "0";
sleep 10; # do a ps here
@x = ();
sleep 30; # do a ps hereand watch the process on Linux. If I'm right, this should show a large process, then a smaller one.
If you're getting a growing process though, you probably have a circular data reference. Maybe you have a tree with backpointers, and those backpointers should have been weakened?
-- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 <merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/> Perl/Unix/security consulting, Technical writing, Comedy, etc. etc. See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!