Is there a limit to the size of JSON file which can be handled by Jackson? My JSON can be huge. Simple example:
{
"people": [
{
"Name": "John Smith",
"number": "123-456-789"
},
{MILIONS OF OTHER PEOPLES}
],
"cars": [MILIONS OF CARS],
"dogs": [MILIONS OF DOGS],
MORE HERE
}
It can be 5GB or more. I have to create it by using Jackson and send by network to another system. Memory is not a problem but what about Jackson? Can it write/read it without any problems?
Edit: I don't think it is a duplicate. I'm not asking how to parse huge Json files but what are the limits of Json/Jackson (if any)
Jackson's ObjectMapper
has a bunch of methods for reading JSON.
If you use the ones that take a byte[]
or a String
, then you're obviously restricted by the implicit limits of those types.
If you use the ones that take a File
, an InputStream
, or a Reader
, depending on their underlying implementation, you can stream the whole thing and never hold the entire content of the file in memory at a given moment.
However, the ObjectMapper
has to construct the entire object tree before returning it to your caller. It will need whatever amount of memory is required
to build the objects in that tree.
Jackson imposes no hard limits itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With