帮助更改 OSX Eclipse Java 堆分配

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5661411/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 16:09:57  来源:igfitidea点击:

Help changing OSX Eclipse Java Heap allocation

javaeclipsemacosmemoryheap

提问by Ricardo Sanchez

I need to increase the heap allocation but I think I am missing a step, I follow this instructions http://wiki.eclipse.org/Eclipse.inibut the ini file is different from mine, this is what I get

我需要增加堆分配,但我想我错过了一个步骤,我按照此说明http://wiki.eclipse.org/Eclipse.ini但 ini 文件与我的不同,这就是我得到的

-startup
../../../plugins/org.eclipse.equinox.launcher_1.1.1.R36x_v20101122_1400.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx_1.1.2.R36x_v20101019_1345
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
-vmargs
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1536m
-XstartOnFirstThread
-Dorg.eclipse.swt.internal.carbon.smallFonts
-XX:MaxPermSize=256m

I change line -Xmx1536mbut still get the out of memory problem, any ideas what else I need to setup? I have the latest 64bit Eclipse IDE and running on OSX 10.6.7

我更改了-Xmx1536m行,但仍然出现内存不足问题,我还需要设置什么?我有最新的 64 位 Eclipse IDE 并在 OSX 10.6.7 上运行

Thanks

谢谢

回答by WhiteFang34

In your comments you clarified that you're trying to increase the memory for an application you're running in Eclipse. What you've been trying increases the memory for Eclipse itself. To increase the memory for an application you're running in Eclipse to 1536m follow these steps:

在您的评论中,您澄清说您正在尝试增加在 Eclipse 中运行的应用程序的内存。您一直在尝试的方法会增加 Eclipse 本身的内存。要将您在 Eclipse 中运行的应用程序的内存增加到 1536m,请执行以下步骤:

  1. Go to Run > Run Configurations...
  2. Select your Java Application
  3. Go to the Argumentstab
  4. Add -Xmx1536mto the your VM arguments
  1. 转到运行 > 运行配置...
  2. 选择您的Java 应用程序
  3. 转到参数选项卡
  4. 添加-Xmx1536m到您的VM 参数

回答by Karthik Reddy

It is possible to increase heap size allocated by the JVM in eclipse directly In eclipse IDE goto

可以直接在eclipse中增加JVM分配的堆大小在eclipse IDE goto中

Run---->Run Configurations---->

Enter

进入

-Xmx1g

(It is used to set the max size like Xmx256m or Xmx1g...... m-->mb g--->gb)

(用于设置最大尺寸,如 Xmx256m 或 Xmx1g...... m-->mb g--->gb)