Skip to content

Instantly share code, notes, and snippets.

View letanloc1998's full-sized avatar
💭
Don't wish it were easier, wish you were better.

Lê Tấn Lộc letanloc1998

💭
Don't wish it were easier, wish you were better.
View GitHub Profile
@luhn
luhn / README.md
Last active January 3, 2023 18:31
PostgreSQL memory leak

This was performed on Ubuntu 14.04 with a fresh install of PostgreSQL 9.3.14 directly from the official Postgres apt repo. It only works if the query planner chooses the attached plan (with HashAggregate).

Create and populate a new database:

psql -U postgres -c "create database test;"
psql -U postgres test < populate.sql

Open a connection to the database and execute query.sql. The Postgres worker memory usage will rise approximately 50MB and won't be released until the connection is closed.