title: java.lang.OutOfMemoryError: Failed to allocate a 103059952 byte allocation with 16777216 free bytes and 45MB until OOM
body: <p>I've done some research, but haven't had any luck - especially since most answers have to do with a VM.  I'm testing my app on a physical phone - Samsung Galaxy S4.  My app crashes, before the menu screen loads... with the error below.  I don't understand why because I don't have any large images (I checked..the largest png file I have is only 224 KB).</p>
  
  <p>Any idead how to fix? Thanks in advance...    </p>
  
  <pre><code>03-07 10:19:56.199  18473-18493/com.packtpub.libgdx.outtacluck.android E/AndroidRuntime﹕ FATAL EXCEPTION: GLThread 7662
  Process: com.packtpub.libgdx.outtacluck.android, PID: 18473
  java.lang.OutOfMemoryError: Failed to allocate a 103059952 byte allocation with 16777216 free bytes and 45MB until OOM
          at java.util.ArrayList.add(ArrayList.java:118)
          at com.packtpub.libgdx.outtacluck.screens.MenuScreen.buildScoresWindowLayer(MenuScreen.java:499)
          at com.packtpub.libgdx.outtacluck.screens.MenuScreen.rebuildStage(MenuScreen.java:152)
          at com.packtpub.libgdx.outtacluck.screens.MenuScreen.show(MenuScreen.java:128)
          at com.packtpub.libgdx.outtacluck.screens.DirectedGame.setScreen(DirectedGame.java:51)
          at com.packtpub.libgdx.outtacluck.ChickenMain.create(ChickenMain.java:51)
          at com.badlogic.gdx.backends.android.AndroidGraphics.onSurfaceChanged(AndroidGraphics.java:243)
          at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1520)
          at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
  </code></pre>
  
  <p>Here's the function that triggers the error:</p>
  
  <pre><code>private Table buildScoresWindowLayer() {
      scores = new Window("Top 5 High Scores", skinLibgdx);
  
      FileHandle file = Gdx.files.internal("data/highscores.txt");
      BufferedReader reader = new BufferedReader(file.reader());
      ArrayList&lt;String&gt; lines = new ArrayList&lt;String&gt;();
      String line = null;
      try {
          line = reader.readLine();
      } catch (IOException e) {
          e.printStackTrace();
      }
      while (line != null){
          lines.add(line);
      }
  
  
      scores.add(lines.get(0));
      scores.add(lines.get(0));
  
      scores.add(lines.get(0));
      scores.add(lines.get(0));
      scores.add(lines.get(0));
  
  
      // + Character Skin: Selection Box (White, Gray, Brown)
      //scores.add(buildOptWinSkinSelection()).row();
  
      // + Debug: Show FPS Counter
      //scores.add(buildOptWinDebug()).row();
  
      // + Separator and Buttons (Save, Cancel)
     scores.add(buildScoresWinButtons()).pad(10, 0, 10, 0);
  
      // Make options window slightly transparent
      scores.setColor(1, 1, 1, 0.8f);
  
      // Hide options window by default
      showScoresWindow(false, false);
  
      if (debugEnabled)
          scores.debug();
  
      // Let TableLayout recalculate widget sizes and positions
      scores.pack();
  
      // Move options window to bottom right corner
      scores.setPosition(Constants.VIEWPORT_GUI_WIDTH - scores.getWidth() - 150, 50);
      return scores;
  }
  </code></pre>