Reduces memory used during testing
Merge pull request #4699 from yurydelendik/testmem

Reduces memory used during testing