Skip to content

Commit d079277

Browse files
Merge pull request #14 from Kernel-Science/add-agent-skill
Cap jixia concurrency to avoid OOM in load step
2 parents 2914c68 + b50b4d0 commit d079277

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/weekly-index.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ jobs:
1414
JIXIA_REPO: https://github.com/frenzymath/jixia
1515
MODULE_NAMES: Physlib
1616
DRY_RUN: 'false'
17+
# Each jixia worker loads ~2-3 GB of Mathlib; cap concurrency so the
18+
# runner (16 GB) doesn't get OOM-killed during the load step.
19+
JIXIA_MAX_WORKERS: '2'
1720
CHROMA_PATH: chroma
1821
CONNECTION_STRING: ${{ secrets.DATABASE_URL }}
1922
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}

database/jixia_db.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,18 @@ def topological_sort():
176176
with conn.cursor() as cursor:
177177
lean_sysroot = Path(os.environ["LEAN_SYSROOT"])
178178
lean_src = lean_sysroot / "src" / "lean"
179+
# Each jixia worker loads the full Mathlib environment (~2-3 GB), so the
180+
# default thread count (CPUs + 4) can exhaust memory and get the process
181+
# OOM-killed. Cap it via JIXIA_MAX_WORKERS in memory-constrained CI.
182+
max_workers_env = os.environ.get("JIXIA_MAX_WORKERS")
183+
max_workers = int(max_workers_env) if max_workers_env else None
179184
all_modules = []
180185
for d in project.root, lean_src:
181186
results = project.batch_run_jixia(
182187
base_dir=d,
183188
prefixes=prefixes,
184189
plugins=["module", "declaration", "symbol"],
190+
max_workers=max_workers,
185191
)
186192
modules = [r[0] for r in results]
187193
load_module(modules, d)

0 commit comments

Comments
 (0)