Skip to content

Commit

Permalink
fix: don’t update mem stat if exceeded the memory limit (#370)
Browse files Browse the repository at this point in the history
  • Loading branch information
nyannyacha authored Jun 19, 2024
1 parent 29d2176 commit b135a19
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/base/src/deno_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,15 +158,15 @@ impl MemCheck {
let heap_stats = WorkerHeapStatistics::from(&stats);
let mut state = self.state.write().unwrap();

state.current = heap_stats;
if !state.exceeded {
state.current = heap_stats;

if total_bytes >= limit {
if !state.exceeded {
if total_bytes >= limit {
state.exceeded = true;
}

drop(state);
self.notify.notify_waiters();
drop(state);
self.notify.notify_waiters();
}
}

total_bytes
Expand Down

0 comments on commit b135a19

Please sign in to comment.