Proposal: a better way to track memory for chunks. #14358
Labels
epic/memory-management
help wanted
Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
proposal
sig/execution
SIG execution
type/enhancement
The issue or PR belongs to an enhancement.
Feature Request
Is your feature request related to a problem? Please describe:
It's hard to estimate memory usage of a
chunk.Chunk
during sql execution.We often use these sort of code, and it's make us think every time we call a method of
Chunk
.Describe the feature you'd like:
I propose a more friendly and object-oriented way to handle memory trakcer for
chunk.Chunk
,when a chunk created, we should
And a method of
Chunk
is called, it'sChunk
's responsibility to track the memory difference. For example,But how we release the memory usage when the
Chunk
is not used anymore.Close
method and call it dumbly.runtime.SetFinalizer
when the memory is actually garbage collected (like destructors in C++). But we need ensure that it does not regress performance.Describe alternatives you've considered:
We have many components that need to track memory during a SQL execution. And this method can be generalized to other components.
chunk.Chunk
chunk.Column
chunk.Chunk
.chunk.List
chunk.ListInDisk
chunk.RowContainer
chunk.hashRowContainer
chunk.RowContainer
and a hash mapTeachability, Documentation, Adoption, Migration Strategy:
The text was updated successfully, but these errors were encountered: