内存不足:ffmpeg库的Java堆空间错误 [英] Wired Out of memory: Java heap space error with ffmpeg library

查看:113
本文介绍了内存不足:ffmpeg库的Java堆空间错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我得到的错误:

Out of memory: Java heap space.
Please assign more memory to Gradle in the project's gradle.properties file.
For example, the following line, in the gradle.properties file, sets the maximum Java heap size to 1,024 MB:
<em>org.gradle.jvmargs=-Xmx1024m</em>

这是因为:

implementation 'nl.bravobit:android-ffmpeg:1.1.7'

当我删除错误消失时,错误是说将堆大小增加到1024MB,而我确实将其增加到10GB,这仍然无法正常工作.

when I remove that the error gets gone.Well the error is saying increase the heap size to 1024MB and I did increase it to 10GB it's not still working.That's what is wired.

org.gradle.jvmargs=-Xmx10000m

仍然出现相同的错误.也尝试过此操作:

still getting the same error.also tried this:

<application
        android:largeHeap="true">

仍然没有机会.请不要建议使用其他库,因为我做不到.

still no chance.Please do not suggest to use an alternative library because I can't.

推荐答案

在gradle 5中,他们大大减少了

In gradle 5 they vastly reduced the default memory requirements.

命令行客户端现在从64MB的堆开始,而不是1GB.这可能会影响使用--no-daemon模式直接在客户端VM内部运行的生成.我们不建议使用--no守护程序,但如果必须使用它,则可以使用GRADLE_OPTS环境变量来增加可用内存.

The command line client now starts with 64MB of heap instead of 1GB. This may affect builds running directly inside the client VM using --no-daemon mode. We discourage the use of --no-daemon, but if you must use it, you can increase the available memory using the GRADLE_OPTS environment variable.

Gradle守护程序现在从512MB的堆而不是1GB的堆开始.大型项目可能必须使用org.gradle.jvmargs属性来增加此设置.

The Gradle daemon now starts with 512MB of heap instead of 1GB. Large projects may have to increase this setting using the org.gradle.jvmargs property.

所有工作程序,包括编译器和测试执行程序,现在都以512MB的堆开始.先前的默认值为物理内存的1/4.大型项目可能必须在相关任务上增加此设置,例如JavaCompile或Test.

All workers, including compilers and test executors, now start with 512MB of heap. The previous default was 1/4th of physical memory. Large projects may have to increase this setting on the relevant tasks, e.g. JavaCompile or Test.

增加客户端内存

GRADLE_OPTS=-Xmx1g ./gradlew build

增加守护程序内存

./gradlew -D org.gradle.jvmargs=-Xmx1g

更新:

为进一步说明,gradle使用客户端VM,守护程序VM,辅助VM(并行运行时)以及用于某些任务的其他VM.

For additional clarification, gradle uses a client VM, a daemon VM, worker VMs (when run in parallel), and additional VMs for certain tasks.

可以使用 GRADLE_OPTS 自定义客户端VM.环境变量.

The client VM can be customized using the GRADLE_OPTS environment variable.

可以使用 org.gradle.jvmargs自定义守护程序VM.属性.

工作虚拟机是从守护程序虚拟机派生的,因此将使用相同的设置.

The worker VMs are forked from the daemon VM so will use the same settings.

可以通过任务自定义每个任务的VM.对于示例

The per task VMs can be customized through the task. For example

tasks.withType(JavaCompile){options.compilerArgs + = ['-Xdoclint:none','-Xlint:none','-nowarn']}

根据有关客户端VM使用的gradle文档:

According to the gradle documentation on Client VM usage:

客户端VM仅处理命令行输入/输出,因此很少需要更改其VM选项.

The client VM only handles command line input/output, so it is rare that one would need to change its VM options.

这篇关于内存不足:ffmpeg库的Java堆空间错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆