All in a context!

October 21–24
Level: Intermediate

Postgresql has a special way of handling memory management, which is via specialized data structure called memory context. All the memory allocation and deallocation are done using a memory context. One never requires independent calls to memory functions like free, malloc, etc. in PostgreSQL. Memory contexts are hierarchical in nature, so deleting a parent context deletes and deallocates all the children contexts, this eases the memory handling by avoiding memory leaks. There are also some specialised memory contexts defined like MessageContext, TopTransactionContext, PortalContext, ErrorContext with their specific purposes. There are APIs available to handle the working of memory contexts to create, delete, reallocate, deallocate, reset, or switch to other contexts. There are also APIs available to identify the current context or switch to some globally available memory contexts. This talk aims at discussing the details of memory management in PostgreSQL.

Back

Join Us For PostgreSQL Conference Europe 2025

October 21–24 2025

Radisson Blu Latvija, Riga, Latvia