Add memory counter.