当我使用 gradle 构建时,它失败并显示以下信息:
\n\nOpenJDK 64-Bit Server VM warning: INFO: os::commit_memory(0x0000000788800000, 89128960, 0) failed; error='\xe6\x97\xa0\xe6\xb3\x95\xe5\x88\x86\xe9\x85\x8d\xe5\x86\x85\xe5\xad\x98' (errno=12)\n#\n# There is insufficient memory for the Java Runtime Environment to continue.\n# Native memory allocation (malloc) failed to allocate 89128960 bytes for committing reserved memory.\n# An error report file with more information is saved as:\n# /tmp/jvm-27885/hs_error.log\n\n:app:transformClassesWithDexForBaiduDebug FAILED\n:app:transformClassesWithDexForBaiduDebug (Thread[main,5,main]) completed. Took 25.305 secs.\nRun Code Online (Sandbox Code Playgroud)\n\n系统内存还剩1G,我想这已经足够了:
\n\nMem: 3921316k total, 2735992k used, 1185324k free, 14464k buffers\nSwap: 0k total, 0k used, 0k free, 90224k cached\nRun Code Online (Sandbox Code Playgroud)\n\n添加我在 gradle.properties …