Error:Kotlin: [Internal Error] java.lang.OutOfMemoryError: Java heap space
Answered
Hello!
When writing a program with a loop when compilation occurs, this error appears: "Error: Kotlin: [Internal Error] java.lang.OutOfMemoryError: Java heap space".
I can’t solve this problem, there is no such problem in the new project.
But I need to solve this problem in the current project. Thanks for answers.
P/S/: memory expansion did not solve this problem.
Please sign in to leave a comment.
What is the loop? May you share a project example on GitHub?
Have you increased the memory heap here: https://www.jetbrains.com/help/idea/increasing-memory-heap.html ? What is the value now?
If the value is more than 2 GB, there is a possibility that the loop in infinite one.
Loop - do-while.
Installed memory 4096 MB, returned to the recommended value.
A typical loop cannot eat so much memory. Most probably, this loop never finishes or has a memory leak. Please share the source code of the loop (not only type, but whole body), or even better - an entire project.
Also faced such a problem. It helped me: settings -> Build -> Rebuild Project