title: Java OutOfMemoryError Using Picasso Image
body: <p>I am trying to load an image into an ImageView and am receiving an OutOfMemoryError. The image displays dynamically based on the specific view in the ViewPager. However, after I keep scrolling through the ViewPager, the image eventually fails to load and causes an OutOfMemoryError.</p>
  
  <p>Note that I have 4 View in the ViewPager, and the app appears to crash on View 2. I am guessing the image is simply to large in size, but I was under the impression that Picasso handles accordingly:</p>
  
  <p>Picasso Code:</p>
  
  <pre><code>Picasso.with(getActivity())
      .load(mImageURL)
      .fit()
      .memoryPolicy(MemoryPolicy.NO_CACHE, MemoryPolicy.NO_CACHE)
      .into((ImageView) rootView.findViewById(R.id.comments_image));
  </code></pre>
  
  <p>XML</p>
  
  <pre><code>&lt;ImageView
      android:id="@+id/comments_image"
      android:layout_width="match_parent"
      android:layout_height="0dp"
      android:layout_weight=".525"
      android:background="@color/black"&gt;
  &lt;/ImageView&gt;
  </code></pre>
  
  <p>Error</p>
  
  <pre><code>java.lang.OutOfMemoryError: Failed to allocate a 5074572 byte allocation with 132096 free bytes and 129KB until OOM
       at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
       at android.graphics.Bitmap.nativeCreate(Native Method)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:812)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:789)
       at android.graphics.Bitmap.createBitmap(Bitmap.java:756)
       at android.graphics.drawable.VectorDrawable$VectorDrawableState.createCachedBitmapIfNeeded(VectorDrawable.java:713)
       at android.graphics.drawable.VectorDrawable.draw(VectorDrawable.java:280)
       at com.squareup.picasso.PicassoDrawable.draw(PicassoDrawable.java:105)
       at android.widget.ImageView.onDraw(ImageView.java:1176)
       at android.view.View.draw(View.java:15231)
       at android.view.View.updateDisplayListIfDirty(View.java:14167)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.draw(View.java:15234)
       at android.view.View.updateDisplayListIfDirty(View.java:14167)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.support.design.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1131)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.draw(View.java:15234)
       at android.support.v4.view.ViewPager.draw(ViewPager.java:2341)
       at android.view.View.updateDisplayListIfDirty(View.java:14167)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.support.v4.widget.DrawerLayout.drawChild(DrawerLayout.java:1373)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.updateDisplayListIfDirty(View.java:14162)
       at android.view.View.getDisplayList(View.java:14189)
       at android.view.View.draw(View.java:14959)
       at android.view.ViewGroup.drawChild(ViewGroup.java:3405)
       at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3198)
       at android.view.View.draw(View.java:15234)
       at android.widget.FrameLayout.draw(F
  </code></pre>