Tech: AcceptedForager doesn't clean up after itself in the phaseEnded() method. As a result, the entire working solution of a phase can be kept in memory. When having a lot of phases (which is very unusual unless your result to partititioning) this hurts. In combination with a very big dataset (such as my xmas holiday hobby packing-santas-sleigh competition), this causes OutOfMemoryError. Most (if not all) users use 2 or 3 solver phases, so the death of the Solver already releases that memory before it ever turns into a problem. Testing the fix now on master. I suggest we backport this to 6.0.x as the fix is trivial and harmless.
Master fix: https://github.com/droolsjbpm/optaplanner/commit/3f408cf1c Set the flags correctly if you want me to backport it to 6.0.x.
Fixed on 6.0.x too: http://github.com/droolsjbpm/optaplanner/commit/532ff438d
There is no test case. VERIFIED by looking at the code.