I wonder if it would be helpful to restart the database, then begin
gathering information pg_locks while it can still respond to queries.
I speculate that this is possible because the amount of memory needed
to query pg_locks continues to grow (around 1900MB now).
Dave Owens