And now I've tried it with the entirety of Pike & ulpc in one go. Number of revisions: 61660 Number of commits: 34847 Memory before graphing: ~900 MB Memory max: 2657 MB
I believe that the memory use can be reduced a bit further by detecting some common cases.
With some simple garbage collection, I've now gotten it to keep memory use steady at under 900 MB. Which has the additional benefit of speeding up the actual committing phase (from ~1.6 commits/s to ~3.9 commits/s on my machine). Committing the entirety of Pike thus goes from ~10.7 hours to ~4.4 hours (much better, but still quite a bit too long though...).