DriverContext.getOperatorPreAllocatedMemory uses parent context's getOperatorPreAllocatedMemory

I might be wrong and might not understand internal correctly, but if pipelineContext.getMaxMemorySize() is used for DriverContext.getOperatorPreAllocatedMemory, a driver might consumer more memory than expected. 

At the MemoryManager, memorySize seems to be easily negative value.

        // remove the pre-allocated memory from this size
        memorySize -= operatorContext.getOperatorPreAllocatedMemory().toBytes();

        long delta = memorySize - currentMemoryReservation;
        if (delta <= 0) {
            return true;
        }