代码之家  ›  专栏  ›  技术社区  ›  alfredopacino

增加Eclipse中的默认最大堆空间

  •  0
  • alfredopacino  · 技术社区  · 6 年前

    如何更改Eclipse(Ubuntu18)中运行的所有程序的最大Java堆大小的默认值?

    (我的意思是不为每个入口点设置脚本参数)

    我也不完全确定 Runtime.getRuntime().maxMemory() 给出真实的价值。。

    我甚至把这一行加进去 eclipse.ini

    -Xms256m
    -Xmx4G
    

    提议的副本没有回答我的问题

    2 回复  |  直到 6 年前
        1
  •  1
  •   greg-449    6 年前

    您可以在首选项中为用于运行Java应用程序的JVM设置默认参数。转到“Java”页面>已安装JREs的页面。选择您正在使用的JRE/JDK,然后单击“编辑…”按钮。在编辑对话框中有一个“默认VM参数”字段,您可以在其中放置设置。

        2
  •  0
  •   Rmahajan    6 年前

    以下是在Eclipse中增加JVM堆大小的步骤:

    第一步

    Open Eclipse and in the toolbar menu, go to Run -> Run Configurations
    

    步骤2

    In the left pane of Run Configurations window, navigate to the Java Application node and select the Java application for which you need to increase the heap size. Then in the right pane, click on the Arguments tab.
    

    -Xms256M – JVM will start with an initial memory size of 256 MB
    -Xmx512M – and can use up to a maximum of 512 MB .