We are retrieving a parsed JSON object from a ReST service that includes approximately 100,000 JSON objects.
When attempting to call new JSONObject
on the ReST service request result, we are experiencing a java.lang.OutOfMemoryError
.
We previously attempted increasing the heap size to 512 MB but this was exceeded.
We have attempted to implement Gson but received a java.lang.StackOverflowError
.
What's the best method of working with a large JSON object?