private long getMemoryUsage ( ) { long totalPageSize = 0 ; for ( MemoryBlock page : allocatedPages ) { totalPageSize += page . size ( ) ; } return ( ( inMemSorter == null ) ? 0 : inMemSorter . getMemoryUsage ( ) ) + totalPageSize ; }
Return the total memory usage of this sorter including the data pages and the sorter s pointer array .