Skip to content

Commit b135a19

Browse files
authored
fix: don’t update mem stat if exceeded the memory limit (#370)
1 parent 29d2176 commit b135a19

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

crates/base/src/deno_runtime.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ impl MemCheck {
158158
let heap_stats = WorkerHeapStatistics::from(&stats);
159159
let mut state = self.state.write().unwrap();
160160

161-
state.current = heap_stats;
161+
if !state.exceeded {
162+
state.current = heap_stats;
162163

163-
if total_bytes >= limit {
164-
if !state.exceeded {
164+
if total_bytes >= limit {
165165
state.exceeded = true;
166-
}
167166

168-
drop(state);
169-
self.notify.notify_waiters();
167+
drop(state);
168+
self.notify.notify_waiters();
169+
}
170170
}
171171

172172
total_bytes

0 commit comments

Comments
 (0)