sollhui opened a new pull request, #62104:
URL: https://github.com/apache/doris/pull/62104

   ## Problem
   
   `_adaptive_write_buffer_size()` used `MemoryProfile::load_current_usage()` 
to evaluate memory pressure, but this metric **does not include memtable 
memory**. As a result, even when memtable memory is high, the pressure check 
always reads near zero, causing the write buffer to always use the maximum 4× 
factor and never scale down — defeating the purpose of adaptive sizing.
   
   ## Solution
   
   Replace `MemoryProfile::load_current_usage()` with 
`memtable_memory_limiter()->mem_tracker()->consumption()`, which directly 
reflects actual memtable memory consumption. The scaling logic remains the same:
   
   | Memtable memory usage | Buffer size factor |
   |---|---|
   | > 80% of limit | 1× (minimum) |
   | > 50% of limit | 2× |
   | ≤ 50% of limit | 4× (maximum) |
   
   A null check is added for safety in case the limiter or tracker is not 
initialized.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to