Add memory logger for testing.