This is a follow up on D6252.
We should limit the number of processes used for parallel compilation of OpenCL kernels, to avoid running out of memory.
With all features enabled, some kernels can use up to 3 GB of memory. We can use the available physical RAM to find a limit on the number of processes.
It's not clear if we can get a measurement of available RAM as opposed to total RAM, and big scenes may already be using a significant amount of memory.