howerknea
howerknea

Reputation: 375

In android memory monitor, what is the different between `total count` and `heap count`?

In google docs, it said that,heap count means Number of instances in the selected heap,while total count means Total number of instances outstanding.What is the selected heap? Always, the total count is larger than heap count,so ,where is the other objects besides those in heap?

Upvotes: 4

Views: 422

Answers (2)

mbonnin
mbonnin

Reputation: 7032

There are 3 heaps in Android:

  • App
  • Image
  • Zygote

Total Count is the total across all 3 heaps. Heap Count is the number of objects in the current selected heap.

See https://developer.android.com/studio/profile/am-hprof.html

Upvotes: 4

foolcage
foolcage

Reputation: 1104

total count include the instance in running stack too. heap count is just in heap size.

Upvotes: 1

Related Questions