her*_*rtD 5 memory android out-of-memory gradle
当我使用 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 中添加了一些参数但不起作用:
\n\norg.gradle.jvmargs=-Xms256m -Xmx1024m\nRun Code Online (Sandbox Code Playgroud)\n\n还有其他方法可以解决这个内存问题吗?
\n\n[已解决]\n更新物理内存并构建通过后。
\n在 Windows 上,对我来说,当我增加分页文件时,它就像魅力一样。
转至:控制面板 -> 系统和安全 -> 系统 -> 高级系统设置。如果可以的话,将 10-20 GB 的硬盘驱动器用作分页内存。
| 归档时间: |
|
| 查看次数: |
5171 次 |
| 最近记录: |