Currently, even if caching is disabled, nothing prevents the planner to allocate additional search nodes. Thus, the planner may use more memory than it should.
A first step is to fix the number of created search nodes, such that after caching is disabled the planner never allocates new nodes to the pool.
However, this is not sufficient. While a chance node only has two children, a decision node has as many children as the task has actions. Therefore, decision nodes require more memory than chance nodes. During search, a node allocated in the pool might become a chance node, but it might also become a decision node. If a step now results in much more decision nodes than chance nodes, the run consumes more memory, due to decision nodes requiring more memory. To fix this, we could additionally fix the number of decision nodes after caching is disabled, and disallow more trials in a step if this number is reached.