【错误记录】Android Studio 运行报错 ( There is not enough memory to perform the requested operation. )
生活随笔
收集整理的這篇文章主要介紹了
【错误记录】Android Studio 运行报错 ( There is not enough memory to perform the requested operation. )
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章目錄
- 一、報錯信息
- 二、解決方案
一、報錯信息
Android Studio 運行時 , 突然卡頓 , 操作沒有相應 , 打開任務管理器后 , 顯示 CPU 占用率 100% ;
并由如下提示 :
二、解決方案
打開 C:\Users\octop\AppData\Roaming\Google\AndroidStudio4.2\studio64.exe.vmoptions 文件查看 ,
內容如下 :
# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html -Dfile.encoding=UTF-8 -Xmx1280m -XX:ReservedCodeCacheSize=240m此時打開了兩個 Android Studio 項目 , 一個 IntelliJ IDEA 項目 , 殺死進程后 , 再次打開后 , 關閉一個 Android Studio 項目 , 關閉 IntelliJ IDEA 軟件 , Android Studio 恢復使用 ;
如果上述方法不管用 , 那么按照對話框中的提示 , 嘗試增加 Xmx 值 , 設置為
-Xmx2048m浪費了 2 小時解決上述問題 , 上述方案都不成功 , 復制了一個 Kotlin 源碼文件 , 編輯的時候 , 突然出現上述錯誤 , 刪除 Kotlin 文件之后 , 該錯誤消失 , 目前還不知道具體原因 ;
添加的 Kotlin 代碼中 , 有一個單例類 , 可能與此有關 ;
總結
以上是生活随笔為你收集整理的【错误记录】Android Studio 运行报错 ( There is not enough memory to perform the requested operation. )的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【设计模式】责任链模式 ( 简介 | 适
- 下一篇: 【设计模式】访问者模式 ( 简介 | 适