# How to force daemons deletion

**URL:** <https://discuss.gradle.org/t/how-to-force-daemons-deletion/37089>\
**Category:** Help/Discuss\
**Created:** [July 30, 2020, 4:55pm UTC](https://discuss.gradle.org/t/how-to-force-daemons-deletion/37089 "2020-07-30T16:55:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jorchohyeah](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@jorchohyeah](https://discuss.gradle.org/u/jorchohyeah)\
**Post date:** [July 30, 2020, 4:55pm UTC](https://discuss.gradle.org/t/how-to-force-daemons-deletion/37089/1 "2020-07-30T16:55:50Z")

</div>

Hello Gradle Forums,

Im having the following issue while using Gradle 6.3 (Gradle --version output below):

* * *

## Gradle 6.3

Build time: 2020-03-24 19:52:07 UTC  
Revision: bacd40b727b0130eeac8855ae3f9fd9a0b207c60

Kotlin: 1.3.70  
Groovy: 2.5.10  
Ant: Apache Ant™ version 1.10.7 compiled on September 1 2019  
JVM: 11.0.8 (Ubuntu 11.0.8+10-post-Ubuntu-0ubuntu118.04.1)  
OS: Linux 5.4.0-42-generic amd64

The problem that I’m facing right now, is that everytime I run gradle for an SpringBoot application with the following configuration:

```
org.gradle.jvmargs=-Xmx4g -XX:MaxPermSize=4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8

```

Even when the process finishes, my RAM memory is still used, I have: 16 Gb, so after 3 re-runs (I don’t mean 3 different services, just the same one stopped, and re-run again…) consumes 12 Gb and if I run another one it starts to fulfill the Swap memory (976M) making my entire system to lag.

I’ve tried deleting the gradle configurations as before, but sometimes I get the error below:  
[Stackoverflow post](https://stackoverflow.com/questions/26143740/getting-gradle-error-could-not-reserve-enough-space-for-object-heap-constantly) so if someone could give me a better advice to upgrade my tunning configurations I would be glad to read them too, but I still think that this tunning problem isn’t really the problem, because sometimes it works well, but it still doesn’t free the RAM after execution, and daemon stopped.

What I want to know if there is some way to force Gradle to dispose memory or force kill the daemons, instead of waiting until they get automatically erased (because sometimes after 30 min, my RAM isn’t free yet). Even if I run **gradle --stop** it stops the daemons but the memory isn’t released. Is there something like **gradle --force-kill-daemons**?

I hope I’ve made myself clear and would be glad if you could send me the Documentation links or where I can find more information related to this.

Pages where I’ve been looking:  
[Gradle issue memory consumption Linux](https://github.com/gradle/gradle/issues/9577)  
[Stopped daemons don’t dispose memory](https://github.com/gradle/gradle/issues/1747)

---

<div class="post-metadata">

**Author:** ![jorchohyeah](https://avatars.discourse-cdn.com/v4/letter/j/96bed5/32.png) [@jorchohyeah](https://discuss.gradle.org/u/jorchohyeah)\
**Post date:** [October 12, 2020, 12:16am UTC](https://discuss.gradle.org/t/how-to-force-daemons-deletion/37089/2 "2020-10-12T00:16:20Z")

</div>

Someone has this figured out? I still haven’t solved it, so any help is welcome! Thanks!
