title: OutOfMemoryError - No trace in the console
body: <p>I call the below testMethod, after putting it into a Callable(with other few Callable tasks), from an ExecutorService. I suspect that, the map.put() suffers OutOfMemoryError, as I'm trying to put some 20 million entries. </p>
  
  <p>But, I'm not able to see the error trace in console. Just the thread stops still. I tried to catch the Error ( I know.. we shouldnt, but for debug I caught). But, the error is not caught. Directly enters finally and stops executing.. and the thread stands still.</p>
  
  <pre><code>  private HashMap&lt;String, Integer&gt; testMethod(
          String file   ) { 
  try {
          in = new FileInputStream(new File(file));
          br = new BufferedReader(new InputStreamReader(in), 102400);
          for (String line; (line= br.readLine()) != null;) {
              map.put(line.substring(1,17),
                      Integer.parseInt(line.substring(18,20)));
          }
          System.out.println("Loop End"); // Not executed
  
      } catch(Error e){
          e.printStackTrace(); //Not executed
      }finally {
          System.out.println(map.size()); //Executed
          br.close();
          in.close();
          }
  return map;
  }
  </code></pre>
  
  <p>Wt could be the mistake, I'm doing?</p>
  
  <p>EDIT: This is how I execute the Thread.</p>
  
  <pre><code>Callable&lt;Void&gt; callable1 = new Callable&lt;Void&gt;() {
              @Override
              public Void call() throws Exception {
                  testMethod(inputFile);
                  return null;
              }
          };
  
          Callable&lt;Void&gt; callable2 = new Callable&lt;Void&gt;() {
              @Override
              public Void call() throws Exception {
                  testMethod1();
                  return null;
              }
          };
  
  
  
          List&lt;Callable&lt;Void&gt;&gt; taskList = new ArrayList&lt;Callable&lt;Void&gt;&gt;();
          taskList.add(callable1);
          taskList.add(callable2);
  
  
          // create a pool executor with 3 threads
          ExecutorService executor = Executors.newFixedThreadPool(3);
          List&lt;Future&lt;Void&gt;&gt; future = executor.invokeAll(taskList);
  
          //executor.invokeAll(taskList);
          latch.await();
  </code></pre>
  
  <p><code>future.get(0);future.get(1); //Added this as per SubOptimal'sComment</code></p>
  
  <p>But, this future.get() didn't show OOME in console.</p>