memory saving in validation and random tests even when validation fails