json
json copied to clipboard
parse json OOM
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
- [X] The bug also occurs if the latest version from the
develop
branch is used. - [X] I can successfully compile and run the unit tests.