Skip to content

Commit

Permalink
fix(api): log number of active threads when running GC (#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Feb 18, 2023
1 parent aec44aa commit d09446c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion api/onnx_web/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import gc
from logging import getLogger
from os import environ, path
import threading
from typing import Any, Dict, List, Optional, Union

import torch
Expand Down Expand Up @@ -135,7 +136,7 @@ def get_size(val: Union[int, str, None]) -> SizeChart:


def run_gc(devices: List[DeviceParams] = []):
logger.debug("running garbage collection")
logger.debug("running garbage collection with %s active threads", threading.active_count())
gc.collect()

if torch.cuda.is_available():
Expand Down

0 comments on commit d09446c

Please sign in to comment.