diff options
author | Robert Haas <rhaas@postgresql.org> | 2020-01-09 10:59:07 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2020-01-09 10:59:07 -0500 |
commit | ed10f32e37e9a16814c25e400d7826745ae3c797 (patch) | |
tree | ee16979e46a05e2c6ffc03d92e20a9d8f9ac3732 /doc/src | |
parent | 5acf6d8bb4ec23349604c7c15111959e657ff294 (diff) | |
download | postgresql-ed10f32e37e9a16814c25e400d7826745ae3c797.tar.gz postgresql-ed10f32e37e9a16814c25e400d7826745ae3c797.zip |
Add pg_shmem_allocations view.
This tells you about allocations that have been made from the main
shared memory segment. The original patch also tried to show information
about dynamic shared memory allocation as well, but I decided to
leave that problem for another time.
Andres Freund and Robert Haas, reviewed by Michael Paquier, Marti
Raudsepp, Tom Lane, Álvaro Herrera, and Kyotaro Horiguchi.
Discussion: http://postgr.es/m/20140504114417.GM12715@awork2.anarazel.de
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/catalogs.sgml | 85 | ||||
-rw-r--r-- | doc/src/sgml/xfunc.sgml | 2 |
2 files changed, 86 insertions, 1 deletions
diff --git a/doc/src/sgml/catalogs.sgml b/doc/src/sgml/catalogs.sgml index 55694c43689..85ac79f07ec 100644 --- a/doc/src/sgml/catalogs.sgml +++ b/doc/src/sgml/catalogs.sgml @@ -8363,6 +8363,11 @@ SCRAM-SHA-256$<replaceable><iteration count></replaceable>:<replaceable>&l </row> <row> + <entry><link linkend="view-pg-shmem-allocations"><structname>pg_shmem_allocations</structname></link></entry> + <entry>shared memory allocations</entry> + </row> + + <row> <entry><link linkend="view-pg-stats-ext"><structname>pg_stats_ext</structname></link></entry> <entry>extended planner statistics</entry> </row> @@ -10748,6 +10753,86 @@ SELECT * FROM pg_locks pl LEFT JOIN pg_prepared_xacts ppx </sect1> + <sect1 id="view-pg-shmem-allocations"> + <title><structname>pg_shmem_allocations</structname></title> + + <indexterm zone="view-pg-shmem-allocations"> + <primary>pg_shmem_allocations</primary> + </indexterm> + + <para> + The <structname>pg_shmem_allocations</structname> view shows allocations + made from the server's main shared memory segment. This includes both + memory allocated by <productname>postgres</productname> itself and memory + allocated by extensions using the mechanisms detailed in + <xref linkend="xfunc-shared-addin" />. + </para> + + <para> + Note that this view does not include memory allocated using the dynamic + shared memory infrastructure. + </para> + + <table> + <title><structname>pg_shmem_allocations</structname> Columns</title> + + <tgroup cols="3"> + <thead> + <row> + <entry>Name</entry> + <entry>Type</entry> + <entry>Description</entry> + </row> + </thead> + + <tbody> + <row> + <entry><structfield>name</structfield></entry> + <entry><type>text</type></entry> + <entry>The name of the shared memory allocation. NULL for unused memory + and <literal><anonymous></literal> for anonymous + allocations.</entry> + </row> + + <row> + <entry><structfield>off</structfield></entry> + <entry><type>bigint</type></entry> + <entry>The offset at which the allocation starts. NULL for anonymous + allocations and unused memory.</entry> + </row> + + <row> + <entry><structfield>size</structfield></entry> + <entry><type>bigint</type></entry> + <entry>Size of the allocation</entry> + </row> + + <row> + <entry><structfield>allocated_size</structfield></entry> + <entry><type>bigint</type></entry> + <entry>Size of the allocation including padding. For anonymous + allocations, no information about padding is available, so the + <literal>size</literal> and <literal>allocated_size</literal> columns + will always be equal. Padding is not meaningful for free memory, so + the columns will be equal in that case also.</entry> + </row> + </tbody> + </tgroup> + </table> + + <para> + Anonymous allocations are allocations that have been made + with <literal>ShmemAlloc()</literal> directly, rather than via + <literal>ShmemInitStruct()</literal> or + <literal>ShmemInitHash()</literal>. + </para> + + <para> + By default, the <structname>pg_shmem_allocations</structname> view can be + read only by superusers. + </para> + </sect1> + <sect1 id="view-pg-stats"> <title><structname>pg_stats</structname></title> diff --git a/doc/src/sgml/xfunc.sgml b/doc/src/sgml/xfunc.sgml index 5616524cfd3..ca5e6efd7e4 100644 --- a/doc/src/sgml/xfunc.sgml +++ b/doc/src/sgml/xfunc.sgml @@ -3239,7 +3239,7 @@ CREATE FUNCTION make_array(anyelement) RETURNS anyarray </para> </sect2> - <sect2> + <sect2 id="xfunc-shared-addin"> <title>Shared Memory and LWLocks</title> <para> |