Bug #48083

AbstractCompositeValidator validatedInstancesContainer grows continuosly

Added by Tarcisio Fedrizzi over 8 years ago. Updated over 8 years ago.

Must have
Target version:
Start date:
Due date:
% Done:


Estimated time:


there is a problem in the way AbstractCompositeValidators passes the validatedInstacesContainer to its children.

The code of the addValidator method says:

  98         public function addValidator(\TYPO3\Flow\Validation\Validator\ValidatorInterface $validator) {
  99                 if ($validator instanceof ObjectValidatorInterface) {
 100                         $validator->setValidatedInstancesContainer = $this->validatedInstancesContainer;
 101                 }
 102                 $this->validators->attach($validator);
 103         }

this is wrong because it overwrites the setValidatedInstancesContainer method of the attached validators. Moreover the code doesn't pass the validatedInstancesContainer down to the validators it contains. This causes the contained validators to create their personal instance of validatedInstancesContainer that keeps growing. This renders impossible to work on big collections of objects due to excessive memory consumption.

In the attached patch I moved the correct version of this code to the validate methods of ConjuntionValidator and DisjunctionValidator. I think that it would be safe to pass the validatedInstancesContainer in the setValidatedInstancesContainer of AbstractCompositeValidators. However given that the resolution of validator could be made more dynamic I preferred calling the setValidatedInstancesContainer just before the validation of CompositeValidators children in the validate method.

Tarcisio Fedrizzi.


Related issues

Is duplicate of TYPO3.Flow - Bug #48093: AbstractCompositeValidators memory consumption continuously growNew2013-05-09


Updated by Tarcisio Fedrizzi over 8 years ago

Please close this report because I moved it in the right place.

Sorry for the error,
Tarcisio Fedrizzi.


Updated by Bastian Waidelich over 8 years ago

  • Status changed from New to Closed

Tarcisio Fedrizzi wrote:

Sorry for the error,

No problem and thanks for moving the issue

Also available in: Atom PDF