public class MemoryManager
extends Object
Implements a memory manager that keeps a global context of how many Parquet
writers there are and manages the memory between them. For use cases with
dynamic partitions, it is easy to end up with many writers in the same task.
By managing the size of each allocation, we try to cut down the size of each
allocation and keep the task from running out of memory.
This class balances the allocation size of each writer by resize them averagely.
When the sum of each writer's allocation size is less than total memory pool,
keep them original value.
When the sum exceeds, decrease each writer's allocation size by a ratio.