JAVA_OPTS用于增加堆大小 [英] JAVA_OPTS for increasing heap size

查看:795
本文介绍了JAVA_OPTS用于增加堆大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想增加堆大小。如何使用JAVA_OPTS这样做。我收到以下错误可能是因为堆大小不足

I want to increase my Heap size. How can I use JAVA_OPTS for doing so.I am getting the following error may be this is because of low heap size

UNEXPECTED TOP-LEVEL ERROR:
java.lang.OutOfMemoryError: Java heap space
    at java.util.Arrays.copyOfRange(Arrays.java:3209)
    at java.lang.String.<init>(String.java:215)
    at java.lang.StringBuilder.toString(StringBuilder.java:430)
    at com.android.dx.rop.type.Prototype.withFirstParameter(Prototype.java:370)
    at com.android.dx.rop.code.Rops.ropFor(Rops.java:1210)
    at com.android.dx.cf.code.RopperMachine.run(RopperMachine.java:478)
    at com.android.dx.cf.code.Simulator$SimVisitor.visitConstant(Simulator.java:692)
    at com.android.dx.cf.code.BytecodeArray.parseInstruction(BytecodeArray.java:763)
    at com.android.dx.cf.code.Simulator.simulate(Simulator.java:95)
    at com.android.dx.cf.code.Ropper.processBlock(Ropper.java:684)
    at com.android.dx.cf.code.Ropper.doit(Ropper.java:639)
    at com.android.dx.cf.code.Ropper.convert(Ropper.java:252)
    at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:256)


推荐答案

你应该能够使用这篇文章中的信息。

You should be able to use the information found in this post.

-Xmszzzm

其中zzz是您的最小尺寸。

where zzz is your minimum size.

-Xmxzzzm

其中zzz是你的最大尺寸。

where zzz is your maximum size.

JAVA_OPTS="-Xms128m -Xmx512m"

您可以在VM args上找到更多信息此处

You can find more info on VM args here.

如何在您的环境中全局设置它取决于您的操作系统。您使用的是哪种操作系统?

How to set it globally in your environment depends on your operating system. Which OS are you using?

编辑:我现在看到ubuntu标签。

EDIT: I see the "ubuntu" tag now.

您应该能够将JAVA_OPTs行放在 etc / environment 中。修改 etc / environment 后,您必须注销并重新登录才能使更新的环境变量生效。

You should just be able to put the JAVA_OPTs line in etc/environment. Once you modify etc/environment, you'll have to log out and back in for the updated environment variables to take effect.

这篇关于JAVA_OPTS用于增加堆大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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