diff options
Diffstat (limited to 'src/include/utils/memutils.h')
-rw-r--r-- | src/include/utils/memutils.h | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h index c0987dca155..8abc26abce2 100644 --- a/src/include/utils/memutils.h +++ b/src/include/utils/memutils.h @@ -18,9 +18,6 @@ #define MEMUTILS_H #include "nodes/memnodes.h" -#include "storage/condition_variable.h" -#include "storage/lmgr.h" -#include "utils/dsa.h" /* @@ -51,23 +48,6 @@ #define AllocHugeSizeIsValid(size) ((Size) (size) <= MaxAllocHugeSize) -/* - * Memory Context reporting size limits. - */ - -/* Max length of context name and ident */ -#define MEMORY_CONTEXT_IDENT_SHMEM_SIZE 64 -/* Maximum size (in bytes) of DSA area per process */ -#define MEMORY_CONTEXT_REPORT_MAX_PER_BACKEND ((size_t) (1 * 1024 * 1024)) - -/* - * Maximum size per context. Actual size may be lower as this assumes the worst - * case of deepest path and longest identifiers (name and ident, thus the - * multiplication by 2). The path depth is limited to 100 like for memory - * context logging. - */ -#define MAX_MEMORY_CONTEXT_STATS_SIZE (sizeof(MemoryStatsEntry) + \ - (100 * sizeof(int)) + (2 * MEMORY_CONTEXT_IDENT_SHMEM_SIZE)) /* * Standard top-level memory contexts. @@ -339,66 +319,4 @@ pg_memory_is_all_zeros(const void *ptr, size_t len) return true; } -/* Dynamic shared memory state for statistics per context */ -typedef struct MemoryStatsEntry -{ - dsa_pointer name; - dsa_pointer ident; - dsa_pointer path; - NodeTag type; - int path_length; - int levels; - int64 totalspace; - int64 nblocks; - int64 freespace; - int64 freechunks; - int num_agg_stats; -} MemoryStatsEntry; - -/* - * Static shared memory state representing the DSA area created for memory - * context statistics reporting. A single DSA area is created and used by all - * the processes, each having its specific DSA allocations for sharing memory - * statistics, tracked by per backend static shared memory state. - */ -typedef struct MemoryStatsCtl -{ - dsa_handle memstats_dsa_handle; - LWLock lw_lock; -} MemoryStatsCtl; - -/* - * Per backend static shared memory state for memory context statistics - * reporting. - */ -typedef struct MemoryStatsBackendState -{ - ConditionVariable memcxt_cv; - LWLock lw_lock; - int proc_id; - int total_stats; - bool summary; - dsa_pointer memstats_dsa_pointer; - TimestampTz stats_timestamp; -} MemoryStatsBackendState; - - -/* - * Used for storage of transient identifiers for pg_get_backend_memory_contexts - */ -typedef struct MemoryStatsContextId -{ - MemoryContext context; - int context_id; -} MemoryStatsContextId; - -extern PGDLLIMPORT MemoryStatsBackendState *memCxtState; -extern PGDLLIMPORT MemoryStatsCtl *memCxtArea; -extern PGDLLIMPORT dsa_area *MemoryStatsDsaArea; -extern void ProcessGetMemoryContextInterrupt(void); -extern const char *ContextTypeToString(NodeTag type); -extern void HandleGetMemoryContextInterrupt(void); -extern Size MemoryContextReportingShmemSize(void); -extern void MemoryContextReportingShmemInit(void); -extern void AtProcExit_memstats_cleanup(int code, Datum arg); #endif /* MEMUTILS_H */ |