@Override
    public long getPeakMemoryUsage()
    {
        return memoryManager.getPeakMemoryUsage();
    }
@Test
    public void testBufferPeakMemoryUsage()
    {
        PartitionedOutputBuffer buffer = createPartitionedBuffer(
                createInitialEmptyOutputBuffers(PARTITIONED)
                        .withBuffer(FIRST, 0)
                        .withNoMoreBufferIds(),
                sizeOfPages(5));
        Page page = createPage(1);
        long serializePageSize = PAGES_SERDE.serialize(page).getRetainedSizeInBytes();
        for (int i = 0; i < 5; i++) {
            addPage(buffer, page, 0);
            assertEquals(buffer.getPeakMemoryUsage(), (i + 1) * serializePageSize);
        }
    }