title: How to deal with bad_alloc in android java
body: <p>I am using a <code>ViewPager</code> to show fragments. When i swipe it multiple times it gives following error:</p>
  
  <pre><code>E/libc++abi: terminating with uncaught exception of type std::bad_alloc: std::bad_alloc
  --------- beginning of crash
  A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 6900
  </code></pre>
  
  <p>I am showing and caching image <a href="http://www.technotalkative.com/android-load-images-from-web-and-caching/" rel="noreferrer">(using this)</a> as well as i am using <code>TextView</code> to show text on <code>Fragment</code>.<br>
  I tried to get help from other links but could not get succeed.</p>