- バックアップ一覧
- 差分 を表示
- 現在との差分 を表示
- ソース を表示
- PostgreSQL/解析/MemoryContext へ行く。
Memory Context †
- フラットなメモリ空間を構造化して管理するための機能であり、backendで用いられる。
- メモリコンテキストの初期化時、TopMemoryContextとErrorContextが作成される。この他、トップレベルのメモリコンテキストには、PostmasterContext、CacheMemoryContext、MessageContext、TopTransactionContext、CurTransactionContextがあり、TopMemoryContextは、全てのメモリコンテキストの親である。
参考 - src/backend/utils/mmgr/mcxt.c - https://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;h=refs/heads/REL_12_STABLE
- src/backend/utils/mmgr/README - https://git.postgresql.org/gitweb/?p=postgresql.git;a=tree;h=refs/heads/REL_12_STABLE
Memory Contextの操作 †
Memory Contextを使用することで、メモリ管理が容易になり、メモリリークのバグも減らせる。
基本的なメモリコンテキストの操作は以下の図の通りである。