> For the complete documentation index, see [llms.txt](https://docs.postgresql.tw/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.postgresql.tw/14/internals/system-catalogs/pg_shmem_allocations.md).

# 51.87. pg\_shmem\_allocations

The `pg_shmem_allocations` view shows allocations made from the server's main shared memory segment. This includes both memory allocated by postgres itself and memory allocated by extensions using the mechanisms detailed in [Section 37.10.10](https://www.postgresql.org/docs/13/xfunc-c.html#XFUNC-SHARED-ADDIN).

Note that this view does not include memory allocated using the dynamic shared memory infrastructure.

#### **Table 51.88. `pg_shmem_allocations` Columns**

| <p>Column Type</p><p>Description</p>                                                                                                                                                                                                                                                                                                                           |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><code>name</code> <code>text</code></p><p>The name of the shared memory allocation. NULL for unused memory and <code>\<anonymous></code> for anonymous allocations.</p>                                                                                                                                                                                     |
| <p><code>off</code> <code>int8</code></p><p>The offset at which the allocation starts. NULL for anonymous allocations, since details related to them are not known.</p>                                                                                                                                                                                        |
| <p><code>size</code> <code>int8</code></p><p>Size of the allocation</p>                                                                                                                                                                                                                                                                                        |
| <p><code>allocated\_size</code> <code>int8</code></p><p>Size of the allocation including padding. For anonymous allocations, no information about padding is available, so the <code>size</code> and <code>allocated\_size</code> columns will always be equal. Padding is not meaningful for free memory, so the columns will be equal in that case also.</p> |

Anonymous allocations are allocations that have been made with `ShmemAlloc()` directly, rather than via `ShmemInitStruct()` or `ShmemInitHash()`.

By default, the `pg_shmem_allocations` view can be read only by superusers.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.postgresql.tw/14/internals/system-catalogs/pg_shmem_allocations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
