0

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?

Louis Evans
  • 671
  • 2
  • 8
  • 18
  • 1
    Split up the json or use [streaming](http://stackoverflow.com/questions/9799549/java-android-java-lang-outofmemoryerror-while-building-a-json-object) – Murat Karagöz Jul 11 '16 at 15:47
  • 1
    Wha an App should load a lot of data in a one request? It is normal when that happens, your app lag, performance problems, poo user experience, etc. consider to retrieve your response in chunks and use sqllite to store data you consider relevant instead to keep it in memory. – Daniel Hernández Jul 11 '16 at 15:50

0 Answers0