skip to Main Content

whenever I run an application of build gradle, android studio opens multiple instances of openjdk binary plaform.

  1. I have turned off hotspot. And went further to turning on airplane mode

  2. I have started android studio as administrator

  3. I have done this:
    use org.gradle.jvmargs=-Xms512m -Dfile.encoding=UTF-8 in the gradle.properties instead of org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8

This is really annoying.

I use:
Android studio 4.1.2

image showing multiple java.exe instances

Gradle build:
**
Executing tasks: [:app:assembleDebug] in project C:
UsersHeavenlyAndroidStudioProjectsPhotoGalleryX

Starting Gradle Daemon…
Gradle Daemon started in 4 s 63 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 688 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 550 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 639 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 766 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 945 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 986 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 840 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 890 ms
Starting Gradle Daemon…
Gradle Daemon started in 4 s 58 ms
Starting Gradle Daemon…
Gradle Daemon started in 3 s 966 ms
Starting Gradle Daemon…
Gradle Daemon started in 4 s 126 ms
Starting Gradle Daemon…
Gradle Daemon started in 4 s 379 ms
Starting Gradle Daemon…
Gradle Daemon started in 4 s 511 ms
Starting Gradle Daemon…
**

2

Answers


  1. Basically, you cannot do anything about it. It’s just how it’s made and how it works. As mentioned by @dan1st, Gradle daemon runs on first JVM, compilation needs another and so the android tools. However, it’s a different case scenario if more than 4-5 JVMs are running. If that is the issue, try switching off the mobile hotspot in windows, because the gradle server doesn’t accept connection from a daemon while hotspot is running. Add -Xmx3G to your gradle.properties also. Post the error log from %UserProfile%.gradledaemondaemon-version for android-studio.

    Login or Signup to reply.
  2. You can try setting this properry

    org.gradle.workers.max=(max # of worker processes)
    

    as described at https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search