Thread
Commits
-
Fix memory leak on DSM slot exhaustion.
- 600387f5dd28 11.7 landed
- 95936c795b9f 9.4.26 landed
- a5f45c3dd3b5 9.5.21 landed
- 93be45245272 9.6.17 landed
- aab30cd4edda 10.12 landed
- 24dd34af1435 12.2 landed
- 93745f1e0195 13.0 landed
-
Shared memory leak on DSM slot exhaustion
Thomas Munro <thomas.munro@gmail.com> — 2020-01-30T09:53:38Z
Hello, As reported over on pgsql-general[1], we leak shared memory when we run out of DSM slots. To see this, add the random-run-out-of-slots hack I showed in that thread, create and analyze a table t(i) with a million integers, run with dynamic_shared_memory_type=mmap, and try SELECT COUNT(*) FROM t t1 JOIN t t2 USING (i) a few times and you'll see that pgbase/pg_dynshmem fills up with leaked memory segments each time an out-of-slots errors is raised. (It happens with all DSM types, but then the way to list the segments varies or there isn't one, depending on type and OS.) Here's a draft patch to fix that. [1] https://www.postgresql.org/message-id/CA%2BhUKG%2Bzw87b70yJp%2BOzz6LqS6s9QvdO4%2BhQuZc%3DDWLMi6Od6A%40mail.gmail.com
-
Re: Shared memory leak on DSM slot exhaustion
Robert Haas <robertmhaas@gmail.com> — 2020-01-31T18:37:40Z
On Thu, Jan 30, 2020 at 4:54 AM Thomas Munro <thomas.munro@gmail.com> wrote: > As reported over on pgsql-general[1], we leak shared memory when we > run out of DSM slots. To see this, add the random-run-out-of-slots > hack I showed in that thread, create and analyze a table t(i) with a > million integers, run with dynamic_shared_memory_type=mmap, and try > SELECT COUNT(*) FROM t t1 JOIN t t2 USING (i) a few times and you'll > see that pgbase/pg_dynshmem fills up with leaked memory segments each > time an out-of-slots errors is raised. (It happens with all DSM > types, but then the way to list the segments varies or there isn't > one, depending on type and OS.) Here's a draft patch to fix that. Whoops. The patch looks OK to me. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
-
Re: Shared memory leak on DSM slot exhaustion
Thomas Munro <thomas.munro@gmail.com> — 2020-02-01T02:37:03Z
On Sat, Feb 1, 2020 at 7:37 AM Robert Haas <robertmhaas@gmail.com> wrote: > Whoops. The patch looks OK to me. Pushed.