Skip to content

Fix yyjson leaks when running ./bench_ondemand#2485

Merged
lemire merged 1 commit intosimdjson:masterfrom
jaja360:fix_yyjson_leaks
Oct 3, 2025
Merged

Fix yyjson leaks when running ./bench_ondemand#2485
lemire merged 1 commit intosimdjson:masterfrom
jaja360:fix_yyjson_leaks

Conversation

@jaja360
Copy link
Contributor

@jaja360 jaja360 commented Oct 2, 2025

Short title (summary): Fix memory leaks in yyjson benchmarks (missing yyjson_doc_free)

Description

  • Some yyjson-based benchmarks did not call yyjson_doc_free, causing large memory leaks when running multiple tests (e.g., ./bench_ondemand without filters could exhaust 32 GB RAM).
  • Fixed by ensuring every yyjson_doc created in the benchmarks is properly freed. After this change, Valgrind reports no leaks on affected benchmarks.

Type of change

  • Bug fix
  • New feature
  • Refactor / cleanup
  • Documentation / tests
  • Other (please describe):

How to verify / test

  • Run benchmarks with Valgrind: valgrind --leak-check=full --trace-children=yes build/benchmark/bench_ondemand
  • No more “definitely lost” reports after the changes in this PR.

@lemire
Copy link
Member

lemire commented Oct 3, 2025

wow. Running tests

@lemire lemire merged commit 1fa1af8 into simdjson:master Oct 3, 2025
83 checks passed
@lemire
Copy link
Member

lemire commented Oct 3, 2025

Merged. This will be in the next release.

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.

2 participants