I use NEXRAD PNG preview data in my atmospheric research work, and the NEXRAD PNGs are 12200 x 5400 pixels. This takes over 650 MB of RAM to process.
Normally, you should be able to control ImageMagick use of RAM with environment variables:
MAGICK_MEMORY_LIMITAmount of RAM heap to use
MAGICK_MAP_LIMITAmount of RAM to use before paging to disk
MAGICK_DISK_LIMITA very slow last resort, before crashing.
I tried commands like
but they still paged to disk, taking 1000x longer even with SSD (and wearing the heck out of the SSD with writes).
MAGICK_DISK_LIMIT=100MB mogrify -scale 10% "*.png"
would give error message as expected.
I filed an ImageMagick bug report on this.
I force ImageMagick to use RAM drive, which gave me 1000x speedup by:
MAGICK_TEMPORARY_PATH=/run/shm mogrify -scale 10% "*.png"