pgsql: Limit the verbosity of memory context statistics dumps.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Limit the verbosity of memory context statistics dumps.
Дата
Msg-id E1ZUHjO-00009F-CW@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Limit the verbosity of memory context statistics dumps.

We had a report from Stefan Kaltenbrunner of a case in which postmaster
log files overran available disk space because multiple backends spewed
enormous context stats dumps upon hitting an out-of-memory condition.
Given the lack of similar reports, this isn't a common problem, but it
still seems worth doing something about.  However, we don't want to just
blindly truncate the output, because that might prevent diagnosis of OOM
problems.  What seems like a workable compromise is to limit the dump to
100 child contexts per parent, and summarize the space used within any
additional child contexts.  That should help because practical cases where
the dump gets long will typically be huge numbers of siblings under the
same parent context; while the additional debugging value from seeing
details about individual siblings beyond 100 will not be large, we hope.
Anyway it doesn't take much code or memory space to do this, so let's try
it like this and see how things go.

Since the summarization mechanism requires passing totals back up anyway,
I took the opportunity to add a "grand total" line to the end of the
printout.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/7b5ef8f2d070c075811ec04a0fcb745d67c7fe3f

Modified Files
--------------
src/backend/utils/mmgr/aset.c |   42 ++++++++++++-----
src/backend/utils/mmgr/mcxt.c |   99 +++++++++++++++++++++++++++++++++++++----
src/include/nodes/memnodes.h  |   21 ++++++++-
src/include/utils/memutils.h  |    1 +
4 files changed, 142 insertions(+), 21 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix potential platform dependence in gist regression test.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Further tweak wording of error messages about bad CONTINUE/EXIT