开发者

Memory issues on Android Device: how to approach them?

开发者 https://www.devze.com 2023-02-24 11:26 出处:网络
Apps 开发者_开发知识库work proper in emulator but while getting into device it crashes because of memory issues..

Apps 开发者_开发知识库work proper in emulator but while getting into device it crashes because of memory issues..

Can anyone please tell me how to do memory testing?


You can use tools like DDMS, Eclipse MAT or YourKit (www.yourkit.com) to analyze memory. Memory issues often relate to bitmaps not being recycled properly or just using too many/large images at the same time. Note that bitmaps are in the native heap!

You need to create a hprof file (look for the Debug class of the Android SDK) and then load it into one of the above mentioned profiler tools. http://developer.android.com/reference/android/os/Debug.html#dumpHprofData(java.lang.String)

See these links:

https://developer.android.com/reference/android/os/Debug.html

https://developer.android.com/guide/developing/tools/hprof-conv.html

0

精彩评论

暂无评论...
验证码 换一张
取 消