forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8d0ddcc
committed
Avoid "invalid memory alloc request size" while reading pg_stat_activity.
On a 64-bit machine, if you set track_activity_query_size andmax_connections such that their product exceeds 1GB, shared memorysetup will still succeed (given enough RAM), but attempts to readpg_stat_activity fail with "invalid memory alloc request size".Work around that by using MemoryContextAllocHuge to allocate thelocal copy of the activity strings. Using the "huge" API costs usnothing extra in normal cases, and it seems better than throwingan error and/or explaining to people why they can't do this.This situation seems insanely profligate today, but who knows whatpeople will consider normal in ten or twenty years? So let's fix itin HEAD but not worry about a back-patch.Per report from James Tomson.Discussion:https://postgr.es/m/1CFDCCD6-B268-48D8-85C8-400D2790B2C3@pushd.com1 parentb753bc0 commit8d0ddcc
1 file changed
+10
-2
lines changedLines changed: 10 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3319 | 3319 |
| |
3320 | 3320 |
| |
3321 | 3321 |
| |
| 3322 | + | |
| 3323 | + | |
| 3324 | + | |
| 3325 | + | |
| 3326 | + | |
| 3327 | + | |
| 3328 | + | |
| 3329 | + | |
3322 | 3330 |
| |
3323 | 3331 |
| |
3324 | 3332 |
| |
| |||
3329 | 3337 |
| |
3330 | 3338 |
| |
3331 | 3339 |
| |
3332 |
| - | |
3333 |
| - | |
| 3340 | + | |
| 3341 | + | |
3334 | 3342 |
| |
3335 | 3343 |
| |
3336 | 3344 |
| |
|
0 commit comments
Comments
(0)