如何在 Eclipse 中增加应用程序堆大小?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15313393/
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-10 21:35:42  来源:igfitidea点击:

How to increase application heap size in Eclipse?

eclipsejvmheap

提问by Sophie Sperner

Some say I need to do that in Run Configurations for my application. When I open that window, could you please tell me how to set the right argument and the amount of memory? Say how to set 2GB or 1.5GB?

有人说我需要在我的应用程序的运行配置中这样做。当我打开那个窗口时,你能告诉我如何设置正确的参数和内存量吗?请问如何设置2GB或1.5GB?

回答by benzonico

In the run configuration you want to customize (just click on it) open the tab Argumentsand add -Xmx2048min the VM arguments section. You might want to set the -Xmsas well (small heap size).

在要自定义的运行配置中(只需单击它),打开选项卡Arguments并添加-Xmx2048mVM 参数部分。您可能还想设置-Xms(小堆大小)。

回答by Faakhir

  1. Go to Eclipse Folder
  2. Find Eclipse Icon in Eclipse Folder
  3. Right Click on it you will get option "Show Package Content"
  4. Contents folder will open on screen
  5. If you are on Mac then you'll find "MacOS"
  6. Open MacOS folder you'll find eclipse.ini file
  7. Open it in word or any file editor for edit

    ...

    -XX:MaxPermSize=256m
    
    -Xms40m
    
    -Xmx512m
    

    ...

  8. Replace -Xmx512m to -Xmx1024m

  9. Save the file and restart your Eclipse
  10. Have a Nice time :)
  1. 转到 Eclipse 文件夹
  2. 在 Eclipse 文件夹中查找 Eclipse 图标
  3. 右键单击它,您将获得“显示包内容”选项
  4. 内容文件夹将在屏幕上打开
  5. 如果您使用的是 Mac,那么您会找到“MacOS”
  6. 打开 MacOS 文件夹,你会发现 eclipse.ini 文件
  7. 在 word 或任何文件编辑器中打开它进行编辑

    ...

    -XX:MaxPermSize=256m
    
    -Xms40m
    
    -Xmx512m
    

    ...

  8. 将 -Xmx512m 替换为 -Xmx1024m

  9. 保存文件并重新启动 Eclipse
  10. 有一个美好的时光:)

回答by sashikanta

Find the Run button present on the top of the Eclipse, then select Run Configuration -> Arguments, in VM arguments section just mention the heap size you want to extend as below:

找到 Eclipse 顶部的 Run 按钮,然后选择 Run Configuration -> Arguments,在 VM arguments 部分中只提及您要扩展的堆大小,如下所示:

-Xmx1024m

回答by Chinmoy

In Eclipse Folder there is eclipse.ini file. Increase size -Xms512m -Xmx1024m

在 Eclipse 文件夹中有 eclipse.ini 文件。增加尺寸 -Xms512m -Xmx1024m

回答by Ravi pandey

Open eclipse.ini

打开 eclipse.ini

Search for -Xmx512mor maybe more size it is.

搜索-Xmx512m或可能更大的尺寸。

Just change it to a required size such as I changed it to -Xmx1024m

只需将其更改为所需的大小,例如我将其更改为 -Xmx1024m