# Kotlin Build - java.lang.OutOfMemory

**URL:** <https://discuss.kotlinlang.org/t/kotlin-build-java-lang-outofmemory/833>\
**Category:** Uncategorized\
**Created:** [May 4, 2013, 8:08pm UTC](https://discuss.kotlinlang.org/t/kotlin-build-java-lang-outofmemory/833 "2013-05-04T20:08:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.h.shams](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/m.h.shams/32/1482_2.png) [@m.h.shams](https://discuss.kotlinlang.org/u/m.h.shams)\
**Post date:** [May 4, 2013, 8:08pm UTC](https://discuss.kotlinlang.org/t/kotlin-build-java-lang-outofmemory/833/1 "2013-05-04T20:08:49Z")

</div>

Hi,

What is the minimum requirement to build kotlin ?&nbsp;&nbsp;

I’m using JDK7-64bit (linux) with 4G heap size for Maven, but still getting OutOfMemoryException.&nbsp;&nbsp;

Appreciate your hints and helps.

---

<div class="post-metadata">

**Author:** ![cedricbeust](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/cedricbeust/32/1429_2.png) [@cedricbeust](https://discuss.kotlinlang.org/u/cedricbeust)\
**Post date:** [May 4, 2013, 9:14pm UTC](https://discuss.kotlinlang.org/t/kotlin-build-java-lang-outofmemory/833/2 "2013-05-04T21:14:30Z")

</div>

I saw the same thing but I noticed the problem was not the heap but the PermGen. Not sure if it's the case for you, but this fixed it for me:

``

```kotlin
-XX:PermSize=512m 
```

---

<div class="post-metadata">

**Author:** ![m.h.shams](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/m.h.shams/32/1482_2.png) [@m.h.shams](https://discuss.kotlinlang.org/u/m.h.shams)\
**Post date:** [May 5, 2013, 5:50am UTC](https://discuss.kotlinlang.org/t/kotlin-build-java-lang-outofmemory/833/3 "2013-05-05T05:50:19Z")

</div>

Thanks Cedric.

As you said, PermSize was the issue.
