Comment 1 for bug 566940

Revision history for this message
John A Meinel (jameinel) wrote :

Note:

It is very difficult to get rid of the memory allocated by the fulltext itself. Which will require a bunch more refactoring to get it to work.

Specifically the stack is:

Repository.CommitBuilder.record_entry_contents() reads the 'text' from disk, and passes it to self._add_text_to_weave.

_add_text_to_weave hands off to Repository._add_text

_add_text wraps it in a FulltextContentFactory and hands that record off to _insert_record_stream.

Note that none of these functions use the text content again. So we could be done with it as soon as we push it into the compressed form.

The only thing that comes to mind is some sort of ConsumableText object that just wraps a str until someone indicates that they are done with the memory. (The cheap form is a list where you pop out the string when you know you are done with it.)