3 ms·
Most JSON parsers use an amount of memory that is proportional to the size of the input, independently of whether they can parse deeply nested structures or not
by lovasoa 7y ago
Most JSON parsers use an amount of memory that is proportional to the size of the input, independently of whether they can parse deeply nested structures or not.
A parser that limits the maximum depth of the input can still be made to consume gigabytes of memory on an input of several gigabytes, and there is nothing wrong about that.
Size limits on a production server should be enforced before even starting to parse the JSON, but this has nothing to do with the issue highlighted here.