· 2 min read · updated

A memory limit that fits the computer

The memory limit isn't a fixed 52 GB any more. Each time it checks, the script reads how much memory Windows can promise and stays 4 GB below that. A bigger…

What we did

  • The memory limit isn't a fixed 52 GB any more. Each time it checks, the script reads how much memory Windows can promise and stays 4 GB below that. A bigger pagefile raises the limit, and the safety margin stays the same.
  • The check before a batch now allows 25 GB for Krea, not 22. If a batch can't fit, it doesn't start, and it says how much memory I need to free.
  • It only tries again once per job. If it goes over the limit a second time, it stops and keeps the finished drafts.
  • If the script can't read the memory, it cancels the image. It never carries on without the check.

What I learned

  • Committed memory is what Windows has promised to apps, not the RAM they're using. The most it can promise is the RAM plus the pagefile. I got close to that limit, but the pagefile had never held more than 3.7 GB that day.
  • Measure more than the first image. Krea needs about 1 GB more from the second one on, so a check based on the first can let a batch start that can't finish.
  • Trying again only helps when something might be different the next time.

Problems & fixes

  • With almost every image, the script loaded Krea, made one image, went over the limit on the next, then unloaded Krea and started again. Each image took about 121 seconds instead of 20, and it only went over by 0.4 to 0.7 GB.
  • I tested the fix without the GPU, with stand-ins for SwarmUI and the memory readings. They copied the same problem, then went over the limit twice, tried a 40 GB pagefile, and made a reading fail. Update, 2026-12-01: I've now made 201 real test images with the 40 GB pagefile. None was cancelled for memory, and it peaked at 47 GB, with the limit at 67.9 GB. Since Windows started, the pagefile had never held more than 3.8 GB, so making it bigger mostly raised the limit.

Next

  • Try Krea on the NVMe SSD, so it loads faster.