# autovacuum_work_mem

> The memory ceiling for each autovacuum worker, with -1 meaning that the worker inherits maintenance_work_mem.
---

> [!NOTE]
> **Fact — official short description:** “Sets the maximum memory to be used by each autovacuum worker process.”

## Identity {#identity}

| Field | Value | Meaning |
| --- | --- | --- |
| Type | `integer` | Upstream pg_settings type |
| Context | `sighup` | Takes effect after configuration reload |
| Unit | `kB` | Raw unit |
| Range | `-1` – `2147483647` | Raw limits in the last observed version |
| Enum values | — | — for non-enum types |
| Category | Resource Usage / Memory | Upstream classification |
| Latest boot value | `-1` | -1 kB |
{.fields meta="-"}

## Lifecycle {#lifecycle}

| Fact | Value |
| --- | --- |
| First observed | PG9.4 |
| Present in | PG9.4–19 Beta 3 |
| Removed in | No |
| Introduction commit | [`8693559cacf1`](https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=8693559cacf1765697c32fc38574af3c19ce61c1) — New autovacuum_work_mem parameter |
| Commit date | 2013-12-12 |
| Discussion | — |

## Default history {#default-history}

| Versions | Raw `boot_val` | Unit | Human value |
| --- | --- | --- | --- |
| PG9.4–19 Beta 3 | `-1` | `kB` | -1 kB |
{.full-width caption="Measured PG9.0–19 Beta 3 boot defaults"}

## How it works {#mechanism}

autovacuum_work_mem applies separately to each autovacuum worker process. The default sentinel -1 means to use maintenance_work_mem rather than negative memory.

The setting affects autovacuum workers only; it does not change manually issued VACUUM. It is a SIGHUP-context parameter, so it is configured at server level rather than as a per-session tuning knob.

Because multiple workers can run concurrently, the aggregate potential allocation is the per-worker value multiplied by active autovacuum workers. Memory is only one part of vacuum behavior; I/O throttling, worker count, thresholds, and table activity also matter.

## Tuning advice {#tuning-advice}

> [!TIP]
> **Advice.** These are workload-specific starting points and must be validated with measurements.

| Workload | Guidance |
| --- | --- |
| OLTP | When maintenance_work_mem is large, set an explicit lower autovacuum ceiling unless the concurrent-worker budget clearly fits. Watch vacuum duration, dead-tuple backlog, and latency before increasing it. |
| OLAP | Large relations may justify more memory per worker, but schedule and worker concurrency can dominate. Coordinate the value with autovacuum_max_workers and the maintenance window. |
| Small nodes | Keep -1 only when maintenance_work_mem is itself conservative; otherwise set a smaller explicit value to prevent several workers from exhausting the host. |
{.full-width}

## Pigsty {#pigsty}

Values use the fixed 8-vCPU, 32-GiB, 100-GiB SSD fixture and render the current Pigsty templates for PG19 Beta 3; this does not assert current Pigsty support for that historical or beta release.

| Template | Effective value | Versus upstream boot | Source expression |
| --- | --- | --- | --- |
| OLTP | Unmodified | — | — |
| OLAP | Unmodified | — | — |
| CRIT | Unmodified | — | — |
| TINY | Unmodified | — | — |
{.full-width}

> [!CAUTION]
> **Advice — pending human review.** Fact from the current Pigsty template projection: OLTP: PG9.4–19 Beta 3 unmodified; OLAP: PG9.4–19 Beta 3 unmodified; CRIT: PG9.4–19 Beta 3 unmodified; TINY: PG9.4–19 Beta 3 unmodified. No Pigsty-specific rationale is inferred from an absent override.

## Common pitfalls {#common-pitfalls}

- Reading -1 as a literal negative kilobyte value instead of an inheritance sentinel.
- Assuming the setting controls manual VACUUM.
- Budgeting one worker while several autovacuum workers can run at once.
- Increasing memory to address a vacuum problem actually caused by I/O throttling, thresholds, locks, or insufficient worker capacity.

## Related parameters {#related-parameters}

[`maintenance_work_mem`](/parameters/maintenance-work-mem/) · [`autovacuum_max_workers`](/parameters/autovacuum-max-workers/) · [`autovacuum_worker_slots`](/parameters/autovacuum-worker-slots/) · [`vacuum_buffer_usage_limit`](/parameters/vacuum-buffer-usage-limit/) · [`autovacuum_vacuum_cost_delay`](/parameters/autovacuum-vacuum-cost-delay/)

## References {#references}

- [PostgreSQL 19 Beta 3 — autovacuum_work_mem](https://www.postgresql.org/docs/19/runtime-config-resource.html#GUC-AUTOVACUUM-WORK-MEM)
- [PostgreSQL 18: The Autovacuum Daemon](https://www.postgresql.org/docs/18/routine-vacuuming.html#AUTOVACUUM)
- [Pigsty: Parameter Templates](https://pigsty.io/docs/pgsql/template/)
- [PostgreSQL 19 release notes](https://www.postgresql.org/docs/19/release-19.html)
- [Machine-readable GUC export](/data/guc.jsonl)
