Skip to content

Fix leaked arrays in Jacobian and Hessian bindings - #34

Merged
Transurgeon merged 1 commit into
mainfrom
fix-buildvalue-leak
Nov 10, 2026
Merged

Transurgeon merged 1 commit into
mainfrom
fix-buildvalue-leak

Conversation

@Transurgeon

Copy link
Copy Markdown
Member

Py_BuildValue's "O" adds a reference, so the arrays from PyArray_SimpleNew kept one extra and were never freed. "N" hands the new reference to the tuple. 20k problem_jacobian calls at n=2000 grew RSS by ~665 MB before; flat after.

Py_BuildValue's "O" adds a reference, so the arrays from PyArray_SimpleNew
kept one extra and were never freed. "N" hands the new reference to the
tuple. 20k problem_jacobian calls at n=2000 grew RSS by ~665 MB before; flat
after.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Transurgeon
Transurgeon merged commit 130b9ed into main Nov 10, 2026
19 of 27 checks passed
@Transurgeon
Transurgeon deleted the fix-buildvalue-leak branch November 10, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant