Skip to content

Commit f8c115a

Browse files
Typo and doc fixups for memory context reporting
This fixes comment and docs typos as well as a small documentation change to make it clearer. Found via post-commit review. Author: Rahila Syed <[email protected]> Reviewed-by: Daniel Gustafsson <[email protected]> Discussion: https://postgr.es/m/CAH2L28vt16C9xTuK+K7QZvtA3kCNWXOEiT=gEekUw3Xxp9LVQw@mail.gmail.com
1 parent d2a1ed1 commit f8c115a

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

doc/src/sgml/func.sgml

+2-3
Original file line numberDiff line numberDiff line change
@@ -28780,8 +28780,7 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres}
2878028780
indicate the number aggregated child contexts. When
2878128781
<parameter>summary</parameter> is <literal>false</literal>,
2878228782
<literal>the num_agg_contexts</literal> value is <literal>1</literal>,
28783-
indicating that individual statistics are being displayed. The levels
28784-
are limited to the first 100 contexts.
28783+
indicating that individual statistics are being displayed.
2878528784
</para>
2878628785
<para>
2878728786
Busy processes can delay reporting memory context statistics,
@@ -28796,7 +28795,7 @@ acl | {postgres=arwdDxtm/postgres,foo=r/postgres}
2879628795
statistics are aggregated and a cumulative total is displayed. The
2879728796
<literal>num_agg_contexts</literal> column indicates the number of
2879828797
contexts aggregated in the displayed statistics. When
28799-
<literal>num_agg_contexts</literal> is <literal>1</literal> is means
28798+
<literal>num_agg_contexts</literal> is <literal>1</literal> it means
2880028799
that the context statistics are displayed separately.
2880128800
</para></entry>
2880228801
</row>

src/backend/utils/mmgr/mcxt.c

+8-6
Original file line numberDiff line numberDiff line change
@@ -1493,8 +1493,8 @@ ProcessGetMemoryContextInterrupt(void)
14931493

14941494
/*
14951495
* Create a DSA and send handle to the client process after storing the
1496-
* context statistics. If number of contexts exceed a predefined
1497-
* limit(8MB), a cumulative total is stored for such contexts.
1496+
* context statistics. If number of contexts exceed a predefined limit
1497+
* (1MB), a cumulative total is stored for such contexts.
14981498
*/
14991499
if (memCxtArea->memstats_dsa_handle == DSA_HANDLE_INVALID)
15001500
{
@@ -1512,8 +1512,10 @@ ProcessGetMemoryContextInterrupt(void)
15121512

15131513
/*
15141514
* Pin the DSA area, this is to make sure the area remains attachable
1515-
* even if current backend exits. This is done so that the statistics
1516-
* are published even if the process exits while a client is waiting.
1515+
* even if the backend that created it exits. This is done so that the
1516+
* statistics are published even if the process exits while a client
1517+
* is waiting. Also, other processes that publish statistics will use
1518+
* the same area.
15171519
*/
15181520
dsa_pin(MemoryStatsDsaArea);
15191521

@@ -1580,7 +1582,7 @@ ProcessGetMemoryContextInterrupt(void)
15801582
cxt_id = cxt_id + 1;
15811583

15821584
/*
1583-
* Copy statistics for each of TopMemoryContexts children. This
1585+
* Copy statistics for each of TopMemoryContexts children. This
15841586
* includes statistics of at most 100 children per node, with each
15851587
* child node limited to a depth of 100 in its subtree.
15861588
*/
@@ -1609,9 +1611,9 @@ ProcessGetMemoryContextInterrupt(void)
16091611
}
16101612
memCxtState[idx].total_stats = cxt_id;
16111613

1614+
/* Notify waiting backends and return */
16121615
end_memorycontext_reporting();
16131616

1614-
/* Notify waiting backends and return */
16151617
hash_destroy(context_id_lookup);
16161618

16171619
return;

0 commit comments

Comments
 (0)