0

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?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Nirav Dangi
  • 3,607
  • 4
  • 49
  • 60
  • http://stackoverflow.com/questions/3112671/android-memory-analysing-eclipse-memory-analyzer – bigstones Apr 14 '11 at 13:42
  • This question was already answered in StackOverFlow. Search in the site as : "How to discover memory usage of my application in Android." This will give you your answer. – kishoredbn Apr 14 '11 at 13:40

1 Answers1

2

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

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Mathias Conradt
  • 28,420
  • 21
  • 138
  • 192