S
S
SpawNBK2018-08-30 20:05:02
gradle
SpawNBK, 2018-08-30 20:05:02

Gradle runs a bunch of daemons. How to win?

there was such a problem. I use gradle + IntelliJ IDEA. (in android studio the problem is the same). When you create a project or open it, there is a constant connection to gradle and a running instance of the daemon, until the memory on the PC runs out and Ide closes.
System: Linux Mint 18.2 Sonya RAM 8G Swap 8G java version "1.8.0_181" gradle version 4.4
A bunch of processes appear like:

/usr/lib/jvm/java-8-oracle/bin/java -Xmx1024m -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant -cp /home/$username$ /.gradle/wrapper/dists/gradle-4.4-all/9br9xq1tocpiv8o6njlyu5op1/gradle-4.4/lib/gradle-launcher-4.4.jar org.gradle.launcher.daemon.bootstrap.GradleDaemon 4.4

Each of the processes writes a log to /home/$username$/.gradle/daemon/4.4/ like this:
2:48:01.245 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonMain] Assuming the daemon was started with following jvm opts: [-Xmx1024m, -Dfile.encoding=UTF-8, -Duser.country=RU, -Duser.language=ru, -Duser.variant]
12:48:01.385 [INFO] [org.gradle.launcher.daemon.server.Daemon] start() called on daemon - DefaultDaemonContext[uid=27e6f9ad-20a8-47fe-9a6d-c5f4c76cd7db,javaHome=/usr/lib/jvm/java-8-oracle,daemonRegistryDir=/home/$username$/.gradle/daemon,pid=31965,idleTimeout=10800000,daemonOpts=-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
12:48:01.415 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface tun0
12:48:01.415 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
12:48:01.416 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:48:01.416 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:1143:1d77:8f24:73a1%tun0
12:48:01.417 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface tun0
12:48:01.418 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface enp4s0
12:48:01.418 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
12:48:01.418 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:48:01.419 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:8fc7:6f05:8275:c808%enp4s0
12:48:01.419 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /10.81.0.206
12:48:01.420 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface enp4s0
12:48:01.420 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface enp3s1
12:48:01.421 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? false
12:48:01.421 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? true
12:48:01.422 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /fe80:0:0:0:6b7f:6b12:8d1c:6b7d%enp3s1
12:48:01.422 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote address /192.168.56.15
12:48:01.423 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding remote multicast interface enp3s1
12:48:01.423 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding IP addresses for network interface lo
12:48:01.423 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a loopback interface? true
12:48:01.424 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Is this a multicast interface? false
12:48:01.424 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /0:0:0:0:0:0:0:1%lo
12:48:01.426 [DEBUG] [org.gradle.internal.remote.internal.inet.InetAddresses] Adding loopback address /127.0.0.1
12:48:01.430 [DEBUG] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Listening on [dd425ab1-64e6-4278-bf1e-2ddda7f19e3a port:41893, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]].
12:48:01.435 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] Daemon starting at: Wed Aug 29 12:48:01 SAMT 2018, with address: [dd425ab1-64e6-4278-bf1e-2ddda7f19e3a port:41893, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
12:48:01.436 [INFO] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertising the daemon address to the clients: [dd425ab1-64e6-4278-bf1e-2ddda7f19e3a port:41893, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]]
12:48:01.437 [DEBUG] [org.gradle.launcher.daemon.server.DaemonRegistryUpdater] Advertised daemon context: DefaultDaemonContext[uid=27e6f9ad-20a8-47fe-9a6d-c5f4c76cd7db,javaHome=/usr/lib/jvm/java-8-oracle,daemonRegistryDir=/home/spawn/.gradle/daemon,pid=31965,idleTimeout=10800000,daemonOpts=-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
12:48:01.438 [DEBUG] [org.gradle.launcher.daemon.registry.PersistentDaemonRegistry] Storing daemon address: [dd425ab1-64e6-4278-bf1e-2ddda7f19e3a port:41893, addresses:[/0:0:0:0:0:0:0:1%lo, /127.0.0.1]], context: DefaultDaemonContext[uid=27e6f9ad-20a8-47fe-9a6d-c5f4c76cd7db,javaHome=/usr/lib/jvm/java-8-oracle,daemonRegistryDir=/home/spawn/.gradle/daemon,pid=31965,idleTimeout=10800000,daemonOpts=-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=RU,-Duser.language=ru,-Duser.variant]
12:48:01.448 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on daemon addresses registry.
12:48:01.451 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on daemon addresses registry.
12:48:01.471 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on daemon addresses registry.
12:48:01.472 [LIFECYCLE] [org.gradle.launcher.daemon.server.Daemon] Daemon server started.
12:48:01.474 [DEBUG] [org.gradle.launcher.daemon.bootstrap.DaemonStartupCommunication] Completed writing the daemon greeting. Closing streams...
12:48:01.481 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] stopOnExpiration() called on daemon
12:48:01.483 [ERROR] [org.gradle.internal.remote.internal.inet.TcpIncomingConnector] Cannot accept connection from remote address /192.168.56.15.
12:48:01.484 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] awaitExpiration() called on daemon
12:48:01.490 [DEBUG] [org.gradle.launcher.daemon.server.DaemonStateCoordinator] daemon is running. Sleeping until state changes.
12:48:11.483 [DEBUG] [org.gradle.launcher.daemon.server.Daemon] DaemonExpirationPeriodicCheck running

and so on endlessly. Starting Gradle daemon Connecting Gradle daemon and also infinite. Where to drop tell me? in Ide I see gradle connecting to daemon, gradle starting daemon

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question