Skip to content

Is there a memory leak? #1436

@rspiwoks

Description

@rspiwoks

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions