added memory testing
Merge branch 'reduce_memory_usage' into fix-tests