Skip to content

Commit

Permalink
correct initial values
Browse files Browse the repository at this point in the history
  • Loading branch information
xx01cyx committed Mar 1, 2023
1 parent bcafbfd commit 451d06d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/compute/src/memory_management/memory_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,20 @@ impl GlobalMemoryManager {
) {
use std::time::Duration;

use risingwave_common::util::epoch::Epoch;

use crate::memory_management::policy::MemoryControlStats;

let mut tick_interval =
tokio::time::interval(Duration::from_millis(self.barrier_interval_ms as u64));
let mut memory_control_stats = MemoryControlStats::default();
let mut memory_control_stats = MemoryControlStats {
batch_memory_usage: 0,
streaming_memory_usage: 0,
jemalloc_allocated_mib: 0,
lru_watermark_step: 0,
lru_watermark_time_ms: Epoch::physical_now(),
lru_physical_now_ms: Epoch::physical_now(),
};

loop {
// Wait for a while to check if need eviction.
Expand Down
1 change: 0 additions & 1 deletion src/compute/src/memory_management/policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use risingwave_stream::task::LocalStreamManager;

/// `MemoryControlStats` contains the necessary information for memory control, including both batch
/// and streaming.
#[derive(Default)]
pub struct MemoryControlStats {
pub batch_memory_usage: usize,
pub streaming_memory_usage: usize,
Expand Down

0 comments on commit 451d06d

Please sign in to comment.