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
8 changes: 2 additions & 6 deletions chromadb/api/rust.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,8 @@ def __init__(self, system: System):
max_file_handles = resource.getrlimit(resource.RLIMIT_NOFILE)[0]
else:
max_file_handles = ctypes.windll.msvcrt._getmaxstdio() # type: ignore
self.hnsw_cache_size = (
max_file_handles
# This is integer division in Python 3, and not a comment.
# Each HNSW index has 4 data files and 1 metadata file
// 5
)
# Calculate cache size with a minimum value of 1 to avoid segmentation fault
self.hnsw_cache_size = max(1, max_file_handles // 5)

@override
def start(self) -> None:
Expand Down