title: OutOfMemoryError in my ArrayList
body: <p>So I am trying to write a simple code to put all of the names from an object that has both names and descriptions stored in it.  I want this so I can use it in a autocomplete text box later on.  When running my code I am getting the below error.  I am only loading roughly 26 strings into this code so I can't believe I am really running out of memory at this point, so i'm guessing is inefficient code.</p>
  
  <pre><code>public ArrayList&lt;String&gt; getAllFartsNames(ArrayList&lt;Farts&gt; farray) {
      ArrayList&lt;String&gt; FartsNameArray = new ArrayList&lt;String&gt;();
      int count=0;
      while (count&lt;farray.size()){
          FartsNameArray.add(farray.get(count).name);
      }
  
      return FartsNameArray;
  }
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>FATAL EXCEPTION: main
  Process: com.example.shweber.lanternkeeper, PID: 2492
  java.lang.OutOfMemoryError
      at java.util.ArrayList.add(ArrayList.java:118)
      at com.example.shweber.lanternkeeper.MainActivity.getAllFartsNames(MainActivity.java:138)
      at com.example.shweber.lanternkeeper.MainActivity.onCreate(MainActivity.java:45)
      at android.app.Activity.performCreate(Activity.java:5231)
      at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
      at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
      at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
      at android.app.ActivityThread.access$800(ActivityThread.java:135)
      at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
      at android.os.Handler.dispatchMessage(Handler.java:102)
      at android.os.Looper.loop(Looper.java:136)
      at android.app.ActivityThread.main(ActivityThread.java:5001)
      at java.lang.reflect.Method.invokeNative(Native Method)
      at java.lang.reflect.Method.invoke(Method.java:515)
      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
      at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>When I don't run this function my code works fine.  Any suggestions would be appreciated.</p>