title: Find leaks with AS 3.0 profiler
body: <p>I'm trying to wrap my head around memory leaks and how to detect them in my code without the use of the library <code>leakcanary</code>but rather observing the profiler embedded in Android Studio 3</p>
  
  <p>I just created a new "Hello world" project and launched it on my device, I clicked on the <strong>memory</strong> tab in the profiler and pressed <strong>record memory allocation</strong>, rotated it a few times and checked the result</p>
  
  <p>I got this graph here</p>
  
  <p><a href="https://i.stack.imgur.com/sI9ez.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/sI9ez.png" alt="memory allocation for basic hello world app"></a></p>
  
  <p>What I would like to know is why do I have 4 allocation of MainActivity still in memory? 
  I created one for every rotation but shouldn't they be stopped and garbage collected?
  Perhaps that is not the way to find if a memory leak occurs but I'd like to know how to</p>