git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 79e15c7) | patch
Fix memory leak in LogStandbySnapshot().
Tue, 4 Jun 2013 18:58:46 +0000 (14:58 -0400)
Tue, 4 Jun 2013 18:58:46 +0000 (14:58 -0400)
commit dbc6eb1f4b840d252031419d4bf694316812124f
Fix memory leak in LogStandbySnapshot().

The array allocated by GetRunningTransactionLocks() needs to be pfree'd
when we're done with it. Otherwise we leak some memory during each
checkpoint, if wal_level = hot_standby. This manifests as memory bloat
in the checkpointer process, or in bgwriter in versions before we made
the checkpointer separate.

Reported and fixed by Naoya Anzai. Back-patch to 9.0 where the issue
was introduced.

In passing, improve comments for GetRunningTransactionLocks(), and add
an Assert that we didn't overrun the palloc'd array.
src/backend/storage/ipc/standby.c diff | blob | blame | history
src/backend/storage/lmgr/lock.c diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /