Gradle build error: insufficient memory

When I create using gradle, it failed to cope with the information:

OpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000788800000, 89128960, 0) failed; error='ζ— ζ³•εˆ†ι…ε†…ε­˜' (errno=12)
#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 89128960 bytes for committing reserved memory.
# An error report file with more information is saved as:
# /tmp/jvm-27885/hs_error.log

:app:transformClassesWithDexForBaiduDebug FAILED
:app:transformClassesWithDexForBaiduDebug (Thread[main,5,main]) completed. Took 25.305 secs.

There is 1G left in the system memory, I think this is enough:

Mem:   3921316k total,  2735992k used,  1185324k free,    14464k buffers
Swap:        0k total,        0k used,        0k free,    90224k cached

Add I added some parameters to gradle.properties, but it did not work:

org.gradle.jvmargs=-Xms256m -Xmx1024m

Is there any other way to fix this memory problem?

[SOLVED] After the upgrade, the physical memory and assembly passed.

+4
source share

Source: https://habr.com/ru/post/1621589/


All Articles