jeudi 16 juin 2016

Android Studio - Rotating device causes more and more memory to be used

I have this simple Android Studio project for testing out little code snippets. Today while I was fiddling around with some code, I noticed that each time I rotate my device, it causes the app to use more and more memory. Screenshot of the chart is as follows:

memory increase as I keep rotating the device

Each time I rotate the device, allocated memory increases and free memory amount decreases. When free memory hits zero, it cleans a chunk of memory, but not all. As I keep rotating device back and forth, eventually it causes more free memory made available to the app, and allocated memory keeps increasing and increasing.

This is a simple app with only single TextView and no execution code at all. No database activity, no network activity, no cursor, nothing to cause any memory leak whatsoever.

I tried to dump the java heap, but it looks all jibberish to me.

So is this the expected behavior? What is actually filling up the memory? What is going on?

Aucun commentaire:

Enregistrer un commentaire