|
|
ClientContext & | context |
|
unique_ptr< TemporaryMemoryState > | memory_state |
| | Temporary memory state.
|
|
atomic< idx_t > | unflushed_memory_usage |
| | Total memory usage of unflushed rows.
|
|
atomic< idx_t > | min_batch_index |
| | Minimum batch size.
|
|
atomic< idx_t > | available_memory |
| | The available memory for unflushed rows.
|
|
bool | can_increase_memory |
| | Whether or not we can request additional memory.
|
◆ BatchMemoryManager()
| duckdb::BatchMemoryManager::BatchMemoryManager |
( |
ClientContext & | context, |
|
|
idx_t | initial_memory_request ) |
|
inline |
191737 SetMemorySize(initial_memory_request);
191738 }
atomic< idx_t > min_batch_index
Minimum batch size.
Definition duckdb.cpp:191747
atomic< idx_t > unflushed_memory_usage
Total memory usage of unflushed rows.
Definition duckdb.cpp:191745
atomic< idx_t > available_memory
The available memory for unflushed rows.
Definition duckdb.cpp:191749
bool can_increase_memory
Whether or not we can request additional memory.
Definition duckdb.cpp:191751
unique_ptr< TemporaryMemoryState > memory_state
Temporary memory state.
Definition duckdb.cpp:191743
static TemporaryMemoryManager & Get(ClientContext &context)
Get the TemporaryMemoryManager.
Definition duckdb.cpp:443547
unique_ptr< TemporaryMemoryState > Register(ClientContext &context)
Register a TemporaryMemoryState.
Definition duckdb.cpp:443551
◆ SetMemorySize()
| void duckdb::BatchMemoryManager::SetMemorySize |
( |
idx_t | size | ) |
|
|
inline |
191754 {
191755
191756 idx_t total_max_memory = BufferManager::GetBufferManager(context).GetQueryMaxMemory();
191757 idx_t request_cap = total_max_memory / 4;
191758
191759 size = MinValue<idx_t>(size, request_cap);
191761 return;
191762 }
191763
191764 memory_state->SetRemainingSizeAndUpdateReservation(context, size);
191765 auto next_reservation =
memory_state->GetReservation();
191767
191768
191770 }
191772 }
GOpaque< Size > size(const GMat &src)
uint64_t idx_t
a saner size_t for loop indices etc
Definition duckdb.hpp:237
◆ IncreaseMemory()
| void duckdb::BatchMemoryManager::IncreaseMemory |
( |
| ) |
|
|
inline |
191774 {
191776 return;
191777 }
191779 }
◆ OutOfMemory()
| bool duckdb::BatchMemoryManager::OutOfMemory |
( |
idx_t | batch_index | ) |
|
|
inline |
191781 {
191782#ifdef DUCKDB_ALTERNATIVE_VERIFY
191783
191784 return true;
191785#else
191787 auto guard = Lock();
191789
191790 IncreaseMemory();
191792
191793 return true;
191794 }
191795 }
191796 }
191797 return false;
191798#endif
191799 }
◆ UpdateMinBatchIndex()
| void duckdb::BatchMemoryManager::UpdateMinBatchIndex |
( |
idx_t | current_min_batch_index | ) |
|
|
inline |
191801 {
191803 return;
191804 }
191805 auto guard = Lock();
191806 auto new_batch_index = MaxValue<idx_t>(
min_batch_index, current_min_batch_index);
191808
191811 }
191812 }
bool UnblockTasks(const unique_lock< mutex > &guard)
Unblock all tasks (must hold the lock).
Definition duckdb.hpp:21906
◆ AvailableMemory()
| idx_t duckdb::BatchMemoryManager::AvailableMemory |
( |
| ) |
const |
|
inline |
◆ GetUnflushedMemory()
| idx_t duckdb::BatchMemoryManager::GetUnflushedMemory |
( |
| ) |
|
|
inline |
◆ IncreaseUnflushedMemory()
| void duckdb::BatchMemoryManager::IncreaseUnflushedMemory |
( |
idx_t | memory_increase | ) |
|
|
inline |
◆ ReduceUnflushedMemory()
| void duckdb::BatchMemoryManager::ReduceUnflushedMemory |
( |
idx_t | memory_reduction | ) |
|
|
inline |
191826 {
191828 throw InternalException("Reducing unflushed memory usage below zero!?");
191829 } else {
191831 }
191832 }
◆ IsMinimumBatchIndex()
| bool duckdb::BatchMemoryManager::IsMinimumBatchIndex |
( |
idx_t | batch_index | ) |
|
|
inline |
◆ FinalCheck()
| void duckdb::BatchMemoryManager::FinalCheck |
( |
| ) |
|
|
inline |
191838 {
191840 throw InternalException("Unflushed memory usage is not zero at finalize but %llu",
191842 }
191843 }
The documentation for this class was generated from the following file: