Is there a memory leak?
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start by reproducing the reported growth with the linked Godbolt example, then trace how repeated assignments to YAML::Node manage shared memory. Compare memory use across iterations and identify whether retained allocations come from the node assignment path; done means the behavior is explained and, if confirmed as a leak, a focused regression test demonstrates the fix.
Written by the indexing model from the issue text.
Description
Hi,
I am using yaml-cpp for parsing/emitting YAML because it is very simple and flexible as it comes with many predefined type conversions which can easily be extended.
However, the behaviour of the underlying shared memory management is surprising to say the least: in a simple example as the following, the memory usage will increase out of bounds (several GBytes before the program gets killed).
YAML::Node node;
node["test"] = 42;
for(auto i=0; i<10000000; ++i) {
node["test"] = 42;
}
There is a live repro here: https://godbolt.org/z/4PWezz16r. I first issued an open question on stackoverflow here: https://stackoverflow.com/staging-ground/79939206
While the example is rather artificial, we have cases where we read and override configuration data (YAML) many times, and having such behaviour as described above makes us hesitate to use yaml-cpp.
Thanks for any hints on this. Cheers,
Ralf
- Dominant language
- C++
- Stars
- 6.1k
- Forks
- 2.2k
- Avg merge
- 22h 2m
- Merged PRs (30d)
- 1
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from jbeder/yaml-cpp
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
-
Difficulty 3/5 Half a day Newbie friendliness 55/100
-
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Similar issues
-
Issue-Bug Needs-Triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/winget-cli#6645 ·
Maintainers usually reply within 2 days
-
cleanup help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ESPresense/ESPresense#2602 ·
Maintainers usually reply within 1 day
-
devex good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
artifact:simulation-scenario domain:physics good first issue help wanted role:validation testing
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 3 days