Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions jina/logging/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,11 @@ def used_memory(unit: int = 1024 * 1024 * 1024) -> float:
:return: Memory usage of the current process.
"""
if __windows__:
# TODO: windows doesn't include `resource` module
return 0
try:
import psutil
return psutil.Process().memory_info().rss / unit
except ImportError:
return 0

import resource

Expand Down