设备之间的应用内存使用情况不同 [英] App Memory Usage differs between Devices

查看:52
本文介绍了设备之间的应用内存使用情况不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在两个不同的设备上运行我的应用程序,并从 Android Studio 的 Memroy 选项卡检查应用程序分配的内存.当应用程序在三星设备中运行时,分配的内存约为 60 MB.当应用程序在摩托罗拉设备中运行时,分配的内存约为 40 MB.

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?

设备:三星 Galaxy S4 5.0.1 安卓版

Devices: Samsung Galaxy S4 with 5.0.1 Android Version

摩托罗拉 Moto G2 5.0.2 安卓版

Motorola Moto G2 with 5.0.2 Android Version

推荐答案

三星为其在 Android 上的自定义 UI 提供了额外的库层,这最终会导致应用程序消耗更多内存.

Samsung has additional layer of libraries for their custom UI on Android, which will eventually lead the app to consume more memory.

Moto 设备有库存/原生 Android.

Moto devices have stock/native Android.

与 moto 设备相比,您的变量和对象在两种设备中都占用 x 内存,但在三星中,您的 UI 元素需要更多内存.

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:如果库存android使用Button类,三星将扩展Button类以制作SamsungButton类,该类将具有附加功能(如点击时的水滴声).

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).

这篇关于设备之间的应用内存使用情况不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆