How to process JSON data with 500,000+ lines #360
Unanswered
RahulKesharwani353
asked this question in
Q&A
Replies: 1 comment
|
The problem here is almost certainly the Jackson representation of the input (and possibly the output). JSLT itself probably isn't consuming much memory. This means there isn't a whole lot of simple solutions. I have thought of abandoning Jackson in favour of a more compact representation, but since this doesn't seem to be a very common requirement I haven't gone further than just thinking. Is the top level of your JSON an array? If so, you can use the streaming parser, then, for each object in the array, push the events into a JSON builder. That way you can build each sub-object, transform it, serialize that, then move on, and never actually keep the full representation of the JSON in memory. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey Folks and @larsga,
I got an use case there I need to transform a json file with more than 500,000 lOC, It is consuming lot of memory.
Can anyone please suggest some way to optimize that.
Thanks in advance
All reactions