Skip to content

parse json OOM  #4514

@ddxxsx

Description

@ddxxsx

Description

I have a string, which is about 10MB in memory. However, when I use json::parse(), the memory cost is 1.6GB.
I wonder if it's a bug?

Reproduction steps

A long string with chinese charater encoded with utf-8.
call
json j = json::parse(str);
can trigger this bug.

Expected vs. actual results

lower memory cost.

Minimal code example

No response

Error messages

No response

Compiler and operating system

windows

Library version

branch: develop, commit hash: ee32bfc

Validation

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind: bugstate: needs more infothe author of the issue needs to provide more detailsstate: stalethe issue has not been updated in a while and will be closed automatically soon unless it is updated

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions