Android > 3.0 中位图的支持数据存储在哪里?
Where is stored the backing data of a bitmap in Android > 3.0?
在Android的cache bitmap docs.中有:
In addition, prior to Android 3.0 (API Level 11), the backing data of a bitmap was stored in native memory (...)
那么Android3.0之后,位图的backing data是什么?
进一步挖掘后我发现 the answer:
To set the stage for this lesson, here is how Android's management of bitmap memory has evolved:
On Android Android 2.2 (API level 8) and lower, when garbage collection occurs, your app's threads get stopped. This causes a lag that can degrade performance. Android 2.3 adds concurrent garbage collection, which means that the memory is reclaimed soon after a bitmap is no longer referenced.
On Android 2.3.3 (API level 10) and lower, the backing pixel data for a bitmap is stored in native memory. It is separate from the bitmap itself, which is stored in the Dalvik heap. The pixel data in native memory is not released in a predictable manner, potentially causing an application to briefly exceed its memory limits and crash. From Android 3.0 (API level 11) through Android 7.1 (API level 25), the pixel data is stored on the Dalvik heap along with the associated bitmap. In Android 8.0 (API level 26), and higher, the bitmap pixel data is stored in the native heap.
在Android的cache bitmap docs.中有:
In addition, prior to Android 3.0 (API Level 11), the backing data of a bitmap was stored in native memory (...)
那么Android3.0之后,位图的backing data是什么?
进一步挖掘后我发现 the answer:
To set the stage for this lesson, here is how Android's management of bitmap memory has evolved:
On Android Android 2.2 (API level 8) and lower, when garbage collection occurs, your app's threads get stopped. This causes a lag that can degrade performance. Android 2.3 adds concurrent garbage collection, which means that the memory is reclaimed soon after a bitmap is no longer referenced.
On Android 2.3.3 (API level 10) and lower, the backing pixel data for a bitmap is stored in native memory. It is separate from the bitmap itself, which is stored in the Dalvik heap. The pixel data in native memory is not released in a predictable manner, potentially causing an application to briefly exceed its memory limits and crash. From Android 3.0 (API level 11) through Android 7.1 (API level 25), the pixel data is stored on the Dalvik heap along with the associated bitmap. In Android 8.0 (API level 26), and higher, the bitmap pixel data is stored in the native heap.