Add optional memory size to memory collector.