json icon indicating copy to clipboard operation
json copied to clipboard

parse json OOM

Open ddxxsx opened this issue 2 months ago • 5 comments

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

ddxxsx avatar Nov 25 '24 09:11 ddxxsx