Improved structure and logic for getting memory used