3

In relation to this topic Android: OutofMemoryError....

How Can you see the heap size on ddms (Eclipse)? I can only track allocations and it doesn't show nothing

Community
  • 1
  • 1
Vincent
  • 5,702
  • 14
  • 47
  • 90

2 Answers2

0

this shows max heap memory of device

Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();

this is for heap required by your app

Runtime rt = Runtime.getRuntime();
long maxMemory = rt.maxMemory();
vahid abdi
  • 7,840
  • 4
  • 27
  • 33
0

You can try from code native heap allocation : Debug.getNativeHeapAllocatedSize()

Kocus
  • 1,616
  • 17
  • 30