Comment 3 for bug 566940

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 566940] Re: Reducing peak memory for commit

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Robert Collins wrote:
> I'd like to delete add_text completely, as previously mentioned - moving to
> just a single way to add content to a repo, which will permit commit to a
> stacked repo, and make it easier to be confident we've squelched all these
> copy bugs.
>

Sure, but you would retain the stack of FulltextContentFactory being
passed to another function.

And you can't pass an object to another one without a reference, and
having a reference in the outer means it won't be released in the inner.
_add_text was just a convenience/incremental improvement over add_lines().

We'd still need some way to pass a string to a function and be able to
tell it: "I don't need this anymore, you can do what you want with it."

Also, the current code never deletes 'text', which means that:

text = file.read()

Will hold 2x files in memory while the new one is read, before the old
one is removed. Doing:

text = None
text = file.read()

or some variant on that would get around it.

John
=:_>

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkvM9QIACgkQJdeBCYSNAAPMvgCglUHwFkdUGaLBR2S+8LN3hm9X
xdEAoIFNvdtjaZkMzOXFX1tTC9R93Dov
=vY/0
-----END PGP SIGNATURE-----