title: Read a huge json array file of objects
body: <p>I have a big json file, about ~40Gb in size. When I try to convert this file of array of objects to a list of java objects, it crashes. I've used all sizes of maximum heap <code>xmx</code> but nothing has worked!</p>
  <pre><code>public Set&lt;Interlocutor&gt; readJsonInterlocutorsToPersist() {
      String userHome = System.getProperty(USER_HOME);
      log.debug(&quot;Read file interlocutors &quot;+userHome);
      try {
          ObjectMapper mapper = new ObjectMapper();
          // JSON file to Java object
          Set&lt;Interlocutor&gt; interlocutorDeEntities = mapper.readValue(
                  new File(userHome + INTERLOCUTORS_TO_PERSIST),
                  new TypeReference&lt;Set&lt;Interlocutor&gt;&gt;() {
                  });
          return interlocutorDeEntities;
      } catch (Exception e) {
          log.error(&quot;Exception while Reading InterlocutorsToPersist file.&quot;,
                  e.getMessage());
          return null;
      }
  } 
  </code></pre>
  <p>Is there a way to read this file using <code>BufferedReader</code> and then to push object by object?</p>