簡體   English   中英

bubblewrap 構建失敗,出現 memory 異常

[英]bubblewrap build fails with out of memory exception

我試圖用bubblewrap 構建,但在任何地方都找不到答案。 它說內存不足錯誤

cli ERROR Command failed: gradlew.bat bundleRelease --stacktrace

FAILURE: Build failed with an exception.

* What went wrong:
unable to create native thread: possibly out of memory or process/resource limits reached

* Exception is:
java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

它說它已經用完了 memory 並分配更多我需要運行 java 命令我自己,我不能在這里做任何事情嗎?

如本期所述: https://github.com/GoogleChromeLabs/bubblewrap/issues/611

不幸的是,這是 Windows 上的 JVM 的問題,在 Bubblewrap 中沒有什么可以做的。

在分配 memory 時,似乎 JVM 需要連續的 memory 地址。 Even though the machine may have enough memory, and enough memory free, the JVM can fail to allocate if the memory is fragmented. 此 StackOverflow 問題中有更多詳細信息: Java maximum memory on Windows XP

-Xmx1536 參數是 Android Studio 在創建 Android 項目時使用的默認參數。 在這種情況下刪除 -Xmx1536 有效,但不太可能在所有情況下都有效,原因有兩個:

如果 Gradle 確實需要該數量的 memory,它仍然無法分配它並且構建將失敗(稍后)。 可能仍然無法分配較小的 memory 塊。

重新啟動 Windows 是一種已知在這些情況下也有幫助的解決方案。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM