{"schema": "pgtrue.report/1", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72", "published": "2026-10-19T06:26:25Z", "publisher": "PostgresAI", "article": {"title": "Understand memory management in Amazon RDS for PostgreSQL to avoid out of memory | Amazon Web Services", "url": "https://aws.amazon.com/blogs/database/understand-memory-management-in-amazon-rds-for-postgresql-to-avoid-out-of-memory", "date_published": "2026-08-19T22:21:10Z", "author": "Ankita Singh and Takeshi Ideriha", "publisher": "AWS Database Blog"}, "grade": "B+", "axes": [{"axis": "Factual", "summary": "B+ \u00b7 1 wrong of 18 checked \u00b7 1 caveat"}, {"axis": "Applicable", "summary": "B+ \u00b7 2 wrong of 14 checked \u00b7 2 caveats"}, {"axis": "Consistent", "summary": "B+ \u00b7 1 wrong of 18 checked \u00b7 0 caveats"}, {"axis": "Transparent", "summary": "A \u00b7 0 wrong of 7 checked \u00b7 0 caveats"}, {"axis": "Safe", "summary": "not applicable"}], "findings": [{"anchor": "F3", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F3", "claim": "\u2026every temporary file creation is logged\u2026", "title": "Temporary-file logging records deletion rather than creation", "explanation": "log_temp_files emits the entry when PostgreSQL deletes the file. REL_17_4 src/backend/storage/file/fd.c:1524-1528 and config.sgml document that trigger. Matching timestamps can reflect matching cleanup times. They do not prove that sessions exceeded their budgets simultaneously.", "verdict": "False", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L7830-L7852", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:7830-7852"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/backend/storage/file/fd.c#L1524-L1528", "label": "REL_17_4 \u00b7 src/backend/storage/file/fd.c:1524-1528"}]}, {"anchor": "F1", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F1", "claim": "\u2026version 14 or higher recommended for full feature availability\u2026", "title": "PostgreSQL 14 alone does not provide all demonstrated Aurora features", "explanation": "Aurora documents peak-memory tracking from 14.12, 15.7, and 16.3. It documents rds.enable_memory_management from 14.10 and corresponding later releases. PostgreSQL 14 without a minor-version requirement does not establish full feature availability.", "verdict": "Misleading", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html"}, {"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html"}]}, {"anchor": "F7", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F7", "claim": "\u2026Balanced Both planning and execution are memory-intensive\u2026", "title": "The Balanced classification does not establish high memory use", "explanation": "The CASE expression compares peak ratios without an absolute byte threshold. Zero-byte planning and execution peaks both reach ELSE 'Balanced'. The label cannot establish that either phase consumes substantial memory. It cannot alone justify restructuring the schema.", "verdict": "Misleading", "sources": []}, {"anchor": "F15", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F15", "claim": "\u2026ORDER BY allocated DESC\u2026", "explanation": "pg_size_pretty returns text in REL_17_4 src/include/catalog/pg_proc.dat:7502. ORDER BY allocated therefore sorts the formatted output instead of numeric bytes. The displayed ranking places 8,192 bytes before 40 MB. Sort the qualified numeric input before LIMIT 20. These records do not establish that the displayed text order is impossible.", "verdict": "Misleading", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/include/catalog/pg_proc.dat#L7500-L7503", "label": "REL_17_4 \u00b7 src/include/catalog/pg_proc.dat:7500-7503"}]}, {"anchor": "F2", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F2", "claim": "\u2026the Sort node consumes minimal memory regardless of the result set size\u2026", "explanation": "Top-N heapsort limits retained rows, so increasing input row count need not increase retained memory. Tuple width still matters. REL_17_4 src/backend/utils/sort/tuplesort.c:1256 documents possible work_mem overruns when later tuples are larger. The article should qualify its minimal-memory claim.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/backend/utils/sort/tuplesort.c#L1256-L1259", "label": "REL_17_4 \u00b7 src/backend/utils/sort/tuplesort.c:1256-1259"}]}, {"anchor": "F5", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F5", "claim": "\u2026t3 and t4g small instances on Aurora\u2026", "explanation": "Aurora documentation lists t3.medium, db.t3.large, db.t4g.medium, and db.t4g.large as huge-page exceptions (E-16). The article's phrase 'small instances' does not identify those sizes precisely. Check the exact instance class before applying its RES interpretation. Its later medium-class examples do not claim completeness.", "verdict": "Mostly accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html"}]}, {"anchor": "F6", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F6", "claim": "\u2026max_parallel_workers_per_gather worker processes are launched\u2026", "explanation": "max_parallel_workers_per_gather sets the maximum workers for one Gather or Gather Merge node. E-22 and E-23 describe a ceiling, not a guaranteed launch count. The setting alone does not establish how many workers launched.", "verdict": "Mostly accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L2768-L2775", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:2768-2775"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/backend/utils/misc/guc_tables.c#L3410-L3418", "label": "REL_17_4 \u00b7 src/backend/utils/misc/guc_tables.c:3410-3418"}]}, {"anchor": "F8", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F8", "claim": "\u2026the limit is work_mem x hash_mem_multiplier\u2026", "title": "Hash-operation budgets multiply work_mem by hash_mem_multiplier", "explanation": "REL_17_4 src/backend/executor/nodeHash.c:3592-3613 computes work_mem \u00d7 hash_mem_multiplier in bytes. Separate sort and hash operations can consume separate budgets. The article correctly distinguishes these budgets from a single per-query allocation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/backend/executor/nodeHash.c#L3592-L3613", "label": "REL_17_4 \u00b7 src/backend/executor/nodeHash.c:3592-3613"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L1845-L1850", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:1845-1850"}]}, {"anchor": "F9", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F9", "claim": "\u2026a limit applied to the entire command regardless of the number of parallel workers\u2026", "title": "Parallel maintenance does not multiply the command budget by worker count", "explanation": "PostgreSQL 14.0 and 17.4 documentation apply maintenance_work_mem to the parallel utility command. REL_17_4 src/backend/access/nbtree/nbtsort.c:1720 divides the worker sort budget among participants.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L2802-L2838", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:2802-2838"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/backend/access/nbtree/nbtsort.c#L1720-L1720", "label": "REL_17_4 \u00b7 src/backend/access/nbtree/nbtsort.c:1720-1720"}, {"url": "https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/doc/src/sgml/config.sgml#L2580-L2622", "label": "REL_14_0 \u00b7 doc/src/sgml/config.sgml:2580-2622"}]}, {"anchor": "F10", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F10", "claim": "\u2026outputs memory context information to the PostgreSQL log\u2026", "title": "pg_log_backend_memory_contexts sends context details to the server log", "explanation": "pg_log_backend_memory_contexts requests logging for the specified process and returns Boolean. REL_17_4 doc/src/sgml/func.sgml:28158-28166 states that details appear at LOG level rather than in client results. PostgreSQL 14.0 documents the same behavior.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/func.sgml#L28158-L28166", "label": "REL_17_4 \u00b7 doc/src/sgml/func.sgml:28158-28166"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/src/include/catalog/pg_proc.dat#L8288-L8291", "label": "REL_17_4 \u00b7 src/include/catalog/pg_proc.dat:8288-8291"}, {"url": "https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/doc/src/sgml/func.sgml#L24953-L24976", "label": "REL_14_0 \u00b7 doc/src/sgml/func.sgml:24953-24976"}, {"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/func.sgml#L28161-L28166", "label": "REL_17_4 \u00b7 doc/src/sgml/func.sgml:28161-28166"}]}, {"anchor": "F11", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F11", "claim": "\u2026SET LOCAL is preferred to limit scope to a single transaction.", "title": "SET LOCAL confines the memory setting to the transaction", "explanation": "SET LOCAL expires when the current transaction ends, whether it commits or aborts. REL_17_4 doc/src/sgml/ref/set.sgml:55-56 confirms the example's transaction scope.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/ref/set.sgml#L55-L56", "label": "REL_17_4 \u00b7 doc/src/sgml/ref/set.sgml:55-56"}]}, {"anchor": "F12", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F12", "claim": "\u2026cancel transactions that are requesting memory allocations before the OOM killer is invoked\u2026", "title": "Aurora documents allocation-triggered cancellation under critical memory pressure", "explanation": "Aurora documentation describes canceling transactions that request memory under critical pressure. It documents rds.enable_memory_management as enabled by default for the applicable releases. The article's 17.4 example falls within that release scope.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html"}, {"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.BestPractices.memory.management.html"}]}, {"anchor": "F13", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F13", "claim": "\u2026captures the plan with EXPLAIN ANALYZE on the first execution of each new plan\u2026", "title": "Aurora disables ANALYZE plan capture by default", "explanation": "The Aurora parameter reference gives aurora_stat_plans.with_analyze a default of off. Enabling it includes actual runtime statistics when Aurora first captures a plan.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Monitoring.Query.Plans.html"}]}, {"anchor": "F14", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F14", "claim": "\u2026reducing and stabilizing the connection count directly reduces the memory baseline\u2026", "title": "Connection pooling reduces connection memory overhead", "explanation": "RDS Proxy pools and reuses database connections. Aurora guidance documents incremental memory costs for connections. Reducing backend connections reduces that component of memory consumption.", "verdict": "Accurate", "sources": [{"url": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-proxy.html"}, {"url": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html", "label": "https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/AuroraPostgreSQL.Managing.html"}]}, {"anchor": "F16", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F16", "claim": "\u2026(2 x 4MB x 2.0) + (1 x 4MB) = 20MB per execution\u2026", "title": "The stated operation budgets total 20 MB", "explanation": "Two hash budgets consume 16 MB. One sort budget adds 4 MB. Their stated budget totals 20 MB. PostgreSQL 17.4 documents the work_mem \u00d7 hash_mem_multiplier calculation.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L1833-L1870", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:1833-1870"}]}, {"anchor": "F17", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F17", "claim": "\u2026rows=500529 loops=1)\u2026", "explanation": "Both displayed scans account for 1 million rows. The first totals 500,529 returned rows plus 499,471 filtered rows. The second totals 600,537 returned rows plus 399,463 filtered rows.", "verdict": "Accurate", "sources": []}, {"anchor": "F18", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F18", "claim": "\u2026Buffers: shared hit=43175, temp read=13178 written=13197\u2026", "title": "The shared-buffer totals reconcile across the plan", "explanation": "The parent reports 43,175 shared-buffer hits. Its children account for that total (derived: 34482 + 8693). Both displayed plans preserve this relationship.", "verdict": "Accurate", "sources": []}, {"anchor": "F19", "url": "https://pgtrue.postgres.ai/shared/brief/851c8023-afa5-4b9a-8440-27bcccfc0b72#F19", "claim": "\u2026a single sort node can use up to 5x work_mem\u2026", "explanation": "PostgreSQL 17.4 documentation says a parallel query using four workers may consume five times the memory of a query using none. E-56 supports the article's possible fivefold resource estimate.", "verdict": "Accurate", "sources": [{"url": "https://github.com/postgres/postgres/blob/f8554dee417ffc4540c94cf357f7bf7d4b6e5d80/doc/src/sgml/config.sgml#L2760-L2800", "label": "REL_17_4 \u00b7 doc/src/sgml/config.sgml:2760-2800"}]}]}