Why does OpenJDK Platform Binary stucks open and use too much ram?

I started learning flutter recently and i noticed even if vscode closed OpenJDK Platform Binary stays open and uses too much ram. Should i force close it on task manager everytime i finished working on vscode? Is there any way to automatically close it? enter image description here

2

1 Answer

This is a documented behaviour of gradle. You can see this stackoverflow answer and this closed issue in the flutter github project.

Daemon processes will automatically terminate themselves after 3 hours of inactivity. If you wish to stop a Daemon process before this, you can either kill the process via your operating system or run thegradle --stop command. The --stop switch causes Gradle to request that all running Daemon processes, of the same Gradle version used to run the command, terminate themselves.

You can disable it permanently by following these steps :

The Gradle Daemon is enabled by default, and we recommend always enabling it. You can disable the long-lived Gradle daemon via the--no-daemon command-line option, or by adding org.gradle.daemon=false to your gradle.properties file. You can find details of other ways to disable (and enable) the Daemon in Daemon FAQ further down.

You can find an explanation here about why the daemon is important for performance :

Why the Gradle Daemon is important for performance

The Daemon is a long-lived process, so not only are we able to avoid the cost of JVM startup for every build, but we are able to cache information about project structure, files, tasks, and more in memory.

The reasoning is simple: improve build speed by reusing computations from previous builds. However, the benefits are dramatic: we typically measure build times reduced by 15-75% on subsequent builds. We recommend profiling your build by using --profile to get a sense of how much impact the Gradle Daemon can have for you.

4

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like