~/talk

Where is My Memory? (Postgres Edition)

Talkat PGConf India 2026 · 2026-03-11..03-13· [databases]
links:none on file
links:none on file
slides:none on file

A deliberately buggy external storage extension shows blob reads polluting shared buffers (shared_buffers ~128 MB, total shared memory ~143 MB) and a backend RSS jumping from ~151 MB to ~223 MB when large files are read. Diagnosis uses pg_buffercache views plus real‑time tracing with memleak (eBPF) and visualized with flame graphs to find arena_mmap/arena_malloc allocations done outside palloc and a missing memory-context free; changing to palloc and fixing context deletion resolves the leaks.

AI-written summary · about

  1. 0:00Introduction to memory tracking
  2. 0:27Postgres memory components primer
  3. 3:42Demo setup with buggy extension
  4. 5:10Shared buffers cache demonstration
  5. 8:45Shared buffers pollution issue
  6. 9:49Monitoring backend memory usage
  7. 10:52Memory context hierarchy overview
  8. 11:40External file storage operations
  9. 13:03Undetected memory allocation leak
  10. 14:31Debugging with memleak tool
  11. 16:16Visualizing leak data with flame graphs
  12. 18:30Root cause analysis of leak
  13. 19:32Fixing memory allocation calls
  14. 20:13Post-fix memory context check
  15. 20:54Memory context leak detection
  16. 21:37Debugging unscoped memory context
  17. 22:20Summary and key takeaways
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.