hashicorp/nomad · warning

Memory oversubscription is not enabled; Task "%v.%v" memory_

Error message

Memory oversubscription is not enabled; Task "%v.%v" memory_max value will be ignored. Update the Scheduler Configuration to allow oversubscription.

What it means

memory_max enables memory oversubscription, a feature gated by scheduler configuration. When oversubscription is disabled, any task with a non-zero MemoryMaxMB is invalid-only-as-warning: Nomad warns that memory_max will be ignored and the task will be limited to its hard memory value. It is a warning, not a rejection — the job registers but the oversubscription setting has no effect.

Source

Thrown at nomad/job_endpoint_hooks.go:643

func (v *memoryOversubscriptionValidate) Validate(job *structs.Job) (warnings []error, err error) {
	_, c, err := v.srv.State().SchedulerConfig()
	if err != nil {
		return nil, err
	}

	pool, err := v.srv.State().NodePoolByName(nil, job.NodePool)
	if err != nil {
		return nil, err
	}

	if pool.MemoryOversubscriptionEnabled(c) {
		return nil, nil
	}

	for _, tg := range job.TaskGroups {
		for _, t := range tg.Tasks {
			if t.Resources != nil && t.Resources.MemoryMaxMB != 0 {
				warnings = append(warnings, fmt.Errorf("Memory oversubscription is not enabled; Task \"%v.%v\" memory_max value will be ignored. Update the Scheduler Configuration to allow oversubscription.", tg.Name, t.Name))
			}
		}
	}

	return warnings, err
}

// submissionController is used to protect against job source sizes that exceed
// the maximum as set in server config as job_max_source_size
//
// Such jobs will have their source discarded and emit a warning, but the job
// itself will still continue with being registered.
func (j *Job) submissionController(args *structs.JobRegisterRequest) error {
	if args.Submission == nil {
		return nil
	}
	maxSize := j.srv.GetConfig().JobMaxSourceSize
	submission := args.Submission

View on GitHub (pinned to 482b49bf1a)

Solutions

  1. Enable oversubscription: PUT the scheduler configuration with MemoryOversubscription=true (nomad operator scheduler set-config -memory-oversubscription)
  2. Remove the memory_max field from tasks if oversubscription is intentionally off
  3. Acknowledge and ignore the warning if memory_max being ignored is acceptable

Example fix

// before
task "app" { resources { memory = 256 memory_max = 512 } } // oversubscription off
// after
nomad operator scheduler set-config -memory-oversubscription
// then memory_max = 512 is honored
Defensive patterns

Strategy: validation

Validate before calling

// before submit
oversub, _ := schedulerConfigHasOversubscription() // GET /v1/scheduler/configuration
for _, t := range allTasks(job) {
  if t.Resources != nil && t.Resources.MemoryMaxMB != 0 && !oversub {
    fmt.Printf("warning: %s memory_max will be ignored\n", t.Name)
  }
}

Prevention

When it happens

Trigger: Registering a job where any task has Resources.MemoryMaxMB != 0 while the server's SchedulerConfiguration does not enable memory oversubscription. Raised in Validate when enumerating all task groups and tasks.

Common situations: Copying job specs from a cluster with oversubscription enabled to one without; enabling memory_max in jobs after upgrading Nomad but before enabling the feature via the scheduler config API; scripts that always set memory_max.

Related errors


AI-assisted analysis of hashicorp/nomad@482b49bf1a (2026-09-04). Data as JSON: /api/errors/5cd3a9ed03e25213. Report an issue: GitHub.