0

How to parse data >50mb .There is zip inside json file which is more than 50 mb.please help me to solve this problem i will get out of memory error while parsing.

Sagar Badave
  • 121
  • 1
  • 3
  • 9

1 Answers1

0

You should use Gson or Jackson for this purpose. note.. I have no clue how but you would do great with a pointer.

Loading a 50 mb file all at once would be a problem to the device due to the following :

  1. Large file ... Lots of time to load , affects the users expression towards your app if its public.

  2. Parsing , a 50 mb json file is nothing but 50 mb of arrays . It might not be a good idea to parse it all at once. Note.. Make sure you google on ways to avoid garbage collection.

Now ,

Why Gson or Jackson ?

Well , normally if you would parse a json file it would load it all at once taking a lot of time as well as affecting the memory consumption.

With the help of these , you can load off only a few items in the json file at a time..this is called json streaming.

For example you can use it while loading a product list , loading off a few products into the list as you scroll .

TheAnimatrix
  • 566
  • 1
  • 6
  • 19