问题
I run my App in two different devices and check from Android Studio's Memroy tab the app's allocated memory. When the app runs in the Samsung device, the allocated memory is about 60 MB. When the app runs in the Motorola device, the allocated memory is about 40 MB.
What causes this differnce in memory allocation?
Devices: Samsung Galaxy S4 with 5.0.1 Android Version
Motorola Moto G2 with 5.0.2 Android Version
回答1:
Samsung has additional layer of libraries for their custom UI on Android, which will eventually lead the app to consume more memory.
Moto devices have stock/native Android.
Your variables and objects take x memory in both devices, but your UI elements take more memory in Samsung in comparison to moto device.
examplel: If stock android uses Button class, Samsung will extend the Button class to make SamsungButton class which will have additional features (like water droplet sound on click).
来源:https://stackoverflow.com/questions/33346721/app-memory-usage-differs-between-devices