public function collectGarbage()
    {
        $this->synchronized(function () {
            foreach ($this->timerTasks as $taskId => $timerTask) {
                if ($timerTask->isRunning()) {
                    continue;
                } else {
                    unset($this->timerTasks[$taskId]);
                }
            }
        });
    }