When I have an xml layout like:

```
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/my_image" />

<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:src="@drawable/my_image" />

```

Then there are 2 instances of the bitmap associated with drawable in memory or just one?
['https://Stackoverflow.com/questions/60028662', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2401535/']
When loading drawables from `Resources`, these will be cached with a `DrawableCache` which is a `ThemedResourceCache`.

The `ResourcesImpl` [states in a comment](https://android.googlesource.com/platform/frameworks/base/+/a09e9e4fe112a9db923cfee520ed7acfd708ecdc/core/java/android/content/res/ResourcesImpl.java#622):

> 
> 
> ```
> // First, check whether we have a cached version of this drawable
> // that was inflated against the specified theme. Skip the cache if
> // we're currently preloading or we're not using the cache.
> 
> ```
> 
>
Good question!!!

I have viewed source code and it looks like it will create new bitmap instances for each ImageView. There is a cumbersome process goes under all of that...

ImageView uses Drawable

Drawable uses ImageDecoder

ImageDecoder uses BitmapFactory

BitmapFactory uses [native C++ code](https://android.googlesource.com/platform/frameworks/base/+/7b2f8b8/core/jni/android/graphics/BitmapFactory.cpp) for image decoding. (Look at line 157 and below)

Brief look at the code tells me that it will create new instances of ~~bitmap~~ Drawable for each ImageView even if used same image. I didn't find any logic related to such optimization. 

**UPDATE**

Yes there is a optimization took place in case of bitmap loading. Abhisek Mallick absolutely right. Even without looking into the code it is easy to check. Create a RecyclerView with ImageView's. Load into those ImageView's same bitmap. And try to change the number of items. While changing look at the Profiler->Memory. Memory allocation won't be changed.