First, the memory limit only applies to GNU/Linux, not e.g. Windows.
Short answer: It's a per-process limit for the bash script, which will probably (this is true on the "its children" systems, and the limit is not much use otherwise) also apply to child processes. So each ImageMagick call gets its own separate limit.
Thumbnail generation for images is not part of the job queue (multimedia like videos is a different matter).
Details:
By default, it works like this:
- When wfShellExec is called, it creates a new bash process with proc_open.
- That runs a bash script called limit.sh.
- That new bash process sets the memory limit (wgMaxShellMemory) using
ulimit -v
. - The bash process then runs the desired command with either /usr/bin/timeout (if there's also a wall clock limit) or eval.
The man page for bash's ulimit says '-v' is, "The maximum amount of virtual memory available to the shell, and, on some systems, to its children."
NOTE: There is an option to use cgroups, but it is off by default.