# Memory issues with gradle build

**URL:** <https://discuss.gradle.org/t/memory-issues-with-gradle-build/30543>\
**Category:** Help/Discuss\
**Created:** [February 12, 2019, 11:47am UTC](https://discuss.gradle.org/t/memory-issues-with-gradle-build/30543 "2019-02-12T11:47:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![emartynov](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/emartynov/32/1894_2.png) [@emartynov](https://discuss.gradle.org/u/emartynov)\
**Post date:** [February 12, 2019, 11:47am UTC](https://discuss.gradle.org/t/memory-issues-with-gradle-build/30543/1 "2019-02-12T11:47:27Z")

</div>

Hi guys,

Do you know if I get attention from some Gradle guys?

We finally found a way how to increase memory for workers and moved to Gradle 5.2 and Android Gradle Plugin 3.4.0-beta03.

However, it became a disaster. We have much longer builds now, approximatively 30%, sometimes they never finish. As well we see quite many OOM during running unit tests.

I assume it is because we have a quite extensive build for memory - AGP or kapt are just taking a lot of memory to do things. And later we have lint, and later we have Roboltric tests that also consumes a lot of memory.

We have a quite powerful machine. How could I just tell to gradle to eat all possible memory? I have also suspicious that after run the memory is not released. I see after restart builds are faster and stable in comparing to builds after some time.

If anyone has any idea please help.

---

<div class="post-metadata">

**Author:** ![emartynov](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/emartynov/32/1894_2.png) [@emartynov](https://discuss.gradle.org/u/emartynov)\
**Post date:** [February 12, 2019, 1:39pm UTC](https://discuss.gradle.org/t/memory-issues-with-gradle-build/30543/2 "2019-02-12T13:39:07Z")

</div>

Please delete topic! Looks like I have to go directly to GitHub with my issues.

---

<div class="post-metadata">

**Author:** ![azabost](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/azabost/32/11684_2.png) [@azabost](https://discuss.gradle.org/u/azabost)\
**Post date:** [April 21, 2020, 9:01am UTC](https://discuss.gradle.org/t/memory-issues-with-gradle-build/30543/3 "2020-04-21T09:01:41Z")

</div>

Could you please link the issue on GitHub if you opened one? Did you find a solution to this problem?
