I have made a demo activity. i.e a simple Activity with a layout and a TextView.
I have used
Log.e(kFileString, "Native Heap Allocated Size = "
+ Debug.getNativeHeapAllocatedSize());
Log.e(kFileString, "Native Heap Free Size = "
+ Debug.getNativeHeapFreeSize());
Log.e(kFileString, "Native Heap SIZE = " + Debug.getNativeHeapSize());
for logging the native heap assigned.
I noticed that each time I change the orientation the allocated native heap is increased.
Can someone please tell me why this happens and if there is any documentation about the Android native heap management?
I just ran a sample application and changed the orientation a couple of times with your log lines added in my
onCreate().It kept allocation more and more Heap memory but once the Garbage Collector ran I was back to almost the same Heap size I started from.
Here is the log output: