title: Incremental memory usage of Android Studio
body: <p>I am using Android studio 3.1.3 (latest build as of writing this) with Gradle 3.1.3. </p>
  
  <p>And don't know if it matters or not but I have recently upgraded to Ubuntu 18.04 </p>
  
  <p>Whenever I start Android studio, it starts with very small memory footprint. (single process named java takes around 1GB of RAM)</p>
  
  <p>Now when I start build process, one more java process starts running taking around 500MB of RAM. Still it's no problem as I have 8GB of RAM.</p>
  
  <p>After using studio for about hour or two (includes number of builds as I test on real device), suddenly computer freezes and there are three java process taking up almost 5GB of RAM (approx 2.3, 1.5 and 1.2 GB each). Those processes will not release memory even if studio is seating idle. I have to exit the studio and restart it to make it go away.</p>
  
  <p>Here is the screenshot of my system monitor windows.</p>
  
  <p><a href="https://i.stack.imgur.com/ikHyP.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ikHyP.png" alt="enter image description here"></a></p>
  
  <p>And below is the description of each process. </p>
  
  <p><a href="https://i.stack.imgur.com/LqJuI.png" rel="noreferrer"><img src="https://i.stack.imgur.com/LqJuI.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/ufsvo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/ufsvo.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/B9410.png" rel="noreferrer"><img src="https://i.stack.imgur.com/B9410.png" alt="enter image description here"></a></p>
  
  <p>Is anyone else facing this issue? When I was in Ubuntu 16.04 and old android studio, this was not the problem. Does Ubuntu has to do anything with it?</p>