android-studiobackground-task

Android studio creates 1000+ tasks in background after being closed


I've installed my AS on external SSD (where programs are didn't matter before but maybe it's crucial now). I'm a student so all I make is simple, not too demanding (and outright primitive), so 2374 tasks couldn't be by my hand. Today I've opened my task manager before running AS (it died counting last time and didn't answer inputs). 65 tasks. After AS and during work <100 tasks. Right after closing AS (3h of work) I had 1000 tasks already (but didn't check it before).

Question is: How can I restrain AS' background activity (preferably after closing it's windows)? It's concerning, that there's people that had 300% CPU and I don't want it to burn. But I don't want to restrict helping functionality like fetching documentation either

Remarkable: the day my task manager died counting processes. I closed AS with X button, sent my PC to hibernate AND ejected SSD afterwards, I didn't plug it in anymore when turning on my laptop. In theory, it should've killed all related tasks (or maybe kill my task manager which tried to count nulls). Still, tasks were increasing before TM froze, so something was alive even without SSD.

Windows 11

Last time I tried to use «file/exit» button since it may be considered «clean closing» in some cases. I've found myself with those 1000 tasks right after Meanwhile, I, obviously, expected to have 10 times less tasks

I've done some reading myself:

  1. Similar case
  1. Turning off VCS

Solution

  • You forgot that Android Studio uses a Gradle based build system. Gradle starts itself as daemon in background so it an work faster than if it would have to be started for each task. Not sure if Android Studio always closes persistent Gradle processes when you close it. You can see them in Taskmanager on details page as process java.exe taking up CPU when you build a project.

    BTW: Even installing Android Studio on an external SSD will make it sue a lot of storage in your home folder. There are for example

    After using Android Studio a while this will consume way more storage than Android Studio itself.