我刚刚升级到Android Studio 2.2,因为Gradle构建总是失败,出现多个 java.lang.OutOfMemoryError:无法创建新的本地线程
我的studio.vmoptions文件如下所示:
#定制Android Studio VM选项,请参阅tools.android/tech-docs/configuration -Xms128m -Xmx750m -XX :MaxPermSize = 512m -XX:ReservedCodeCacheSize = 96m -XX:+ UseCompressedOops -XX:+ HeapDumpOnOutOfMemoryErrorulimit -a 给了我以下信息: 核心文件大小(块,-c)0 数据段大小(千字节,-d)无限文件大小(块,-f)无限最大锁定内存(kbytes,-l)无限最大内存大小(千字节,-m)无限制打开文件(-n)256 管道大小(512字节,-p)1 堆栈大小(千字节,-s)8192 cpu时间(秒,-t)无限制最大用户进程(-u)709 虚拟备忘录ry(kbytes,-v)unlimited
我尝试增加我的最大用户进程无济于事。有其他人有这个问题吗?我目前的JDK是1.8.0_102
解决方案我的项目有同样的问题,在升级之前可以毫无问题地构建。 / p>
从2.2.0切换回gradle 2.1.3修复了这个问题。
buildscript { ... 依赖项{ classpath'com.android.tools.build:gradle:2.1.3'} }
I just upgraded to Android Studio 2.2 and I can no longer build my project because the Gradle build always fails with multiple java.lang.OutOfMemoryError: unable to create new native thread
From my research, it seems this could have more to do with my operating system (OSX El Capitan) than with Gradle itself. However, I have attempted several workarounds with no success.
My studio.vmoptions file looks like this:
# custom Android Studio VM options, see tools.android/tech-docs/configuration -Xms128m -Xmx750m -XX:MaxPermSize=512m -XX:ReservedCodeCacheSize=96m -XX:+UseCompressedOops -XX:+HeapDumpOnOutOfMemoryErrorulimit -a gives me the following:
core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited max locked memory (kbytes, -l) unlimited max memory size (kbytes, -m) unlimited open files (-n) 256 pipe size (512 bytes, -p) 1 stack size (kbytes, -s) 8192 cpu time (seconds, -t) unlimited max user processes (-u) 709 virtual memory (kbytes, -v) unlimitedI've tried increasing my max user processes to no avail. Is anyone else having this issue? My current JDK is 1.8.0_102
解决方案I have the same issue with my project which can be built without problem before upgrading.
Switched back to gradle 2.1.3 from 2.2.0 fixed the problem.
buildscript { ... dependencies { classpath 'com.android.tools.build:gradle:2.1.3' } }
更多推荐
Android Studio 2.2,Gradle构建失败,java.lang.OutOfMemoryError:无法创建新的本地线程
发布评论