Memory usage calculation should also depend on the memory size of the value, not just on the number of pages.