diff --git a/vllm/v1/engine/core.py b/vllm/v1/engine/core.py index 922c06b44be8..d7e9cfa3660b 100644 --- a/vllm/v1/engine/core.py +++ b/vllm/v1/engine/core.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project +import gc import os import queue import signal @@ -536,6 +537,11 @@ class EngineCoreProc(EngineCore): self.step_fn = (self.step if self.batch_queue is None else self.step_with_batch_queue) + # Mark the startup heap as static so that it's ignored by GC. + # Reduces pause times of oldest generation collections. + gc.collect() + gc.freeze() + @contextmanager def _perform_handshakes( self,