修改了C:\Users\[用戶名]\.AndroidStudio[x.x]
目錄下的studio64.exe.vmoptions
文件內(nèi)容:
# custom Android Studio VM options, see http://tools.android.com/tech-docs/configuration
-Xms1024m
-Xmx4096m
# <------ increase this to most of your RAM
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=440m
-XX:+UseCompressedOops
-XX:+HeapDumpOnOutOfMemoryError
-Dfile.encoding=UTF-8
結(jié)果重啟studio報錯:
---------------------------
Error launching Android Studio
---------------------------
Failed to create JVM: error code -6.
JVM Path: D:\android\SDK\android-studio\jre\jre
If you already have a 64-bit JDK installed, define a JAVA_HOME variable in
Computer > System Properties > System Settings > Environment Variables.
---------------------------
確定
---------------------------
解決方案:
修改-Xmx4096m
為-Xmx2048m
就可以了,看來是內(nèi)存估值超標(biāo)了O(∩_∩)O