Based on the documentation for the TreeBagger class, it seems that the required operations are quite memory intensive. Without knowing more about the internal planning system used by Matlab, it seems likely that distributing the workload to fewer workers with more memory for each worker is what, according to the planner, would be the most effective way to solve the problem.
The number of workers used / available may also depend on the number of physical cores in the system (other than the number of cores with hypervity), as well as the resources that Matlab can consume.
Dividing intensive memory tasks into less than the maximum number of workers is a common technique in HPC for some types of problems.
source share