I first noticed this happening during the June 30th train.
I've tried string deduplication to lower overall memory usage, and branch cleanup on the gerrit server itself; however, neither have alleviated the problem.
Throwing more hardware at the issue would fix it most likely, but there should be some way to mitigate it in the interim.