简体   繁体   English

Java.lang.OutOfMemory Java堆空间JDeveloper

[英]Java.lang.OutOfMemory Java Heap Space JDeveloper

I am writing an application on Java and it is throwing this error Java.lang.OutOfMemory Java Heap Space JDeveloper . 我在Java上编写一个应用程序,它抛出了这个错误Java.lang.OutOfMemory Java Heap Space JDeveloper I know that I can add java -Xmx512m to the command line to solve the problem. 我知道我可以在命令行中添加java -Xmx512m来解决问题。 However, I need to run this application on JDeveloper. 但是,我需要在JDeveloper上运行此应用程序。 So, my Question is: 所以,我的问题是:

How to increase the size of the Heap on JDveloper? 如何在JDveloper上增加Heap的大小?

Thank you, Sami 萨米,谢谢你

Overview 概观

The reasons JDeveloper can run out of memory include heap limits and large files. JDeveloper可能耗尽内存的原因包括堆限制和大文件。

Heap Limits 堆限制

Files that control the amount of memory afforded to the JVM for JDeveloper upon startup, relative to the jdeveloper/ide/bin/ directory, include: 相对于jdeveloper/ide/bin/目录,控制在启动时为JDeveloper提供给JVM的内存量的文件包括:

  • jdev.conf jdev.conf文件
  • ide.conf ide.conf

Update these files as follows: 更新这些文件如下:

  1. Quit JDeveloper. 退出JDeveloper。
  2. Edit ide.conf . 编辑ide.conf
  3. Append the following 附加以下内容
    \nAddVMOption -Xms256M AddVMOption -Xms256M\nAddVMOption -Xmx1024M AddVMOption -Xmx1024M\n
  4. Edit jdev.conf . 编辑jdev.conf
  5. Find the AddVMOption for the "heap size." 找到“堆大小”的AddVMOption
  6. Change the values as follows: 更改值如下:
    \nAddVMOption -Xmx1024M AddVMOption -Xmx1024M\nAddVMOption -XX:MaxPermSize=1024M AddVMOption -XX:MaxPermSize = 1024M\n

Large Files 大文件

JDeveloper naïvely attempts to parse files having known file extensions that are located in the project's root level directory. JDeveloper天真地尝试解析具有已知文件扩展名的文件,这些文件扩展名位于项目的根级目录中。 A sufficiently large file, such as a 3GB XML file, will cause problems. 足够大的文件(例如3GB XML文件)将导致问题。 To work around this issue, create a subdirectory for the large data and move the file into it. 要解决此问题,请为大数据创建子目录并将文件移入其中。 JDeveloper will not try to find resources in arbitrary subdirectories. JDeveloper不会尝试在任意子目录中查找资源。

Edit ${JDEV_HOME}\\jdev\\bin\\jdev.conf and set the following options: 编辑$ {JDEV_HOME} \\ jdev \\ bin \\ jdev.conf并设置以下选项:

AddVMOption -Xmx512M
AddVMOption -XX:MaxPermSize=512M

then restart JDeveloper. 然后重启JDeveloper。

If your jDeveloper doesn't start after trying the above options, reduce the size from 1024 to 768 to 512 如果尝试上述选项后jDeveloper未启动,请将大小从1024减小到768到512

In 'ide.conf' change 在'ide.conf'中改变

AddVMOption -Xms256M
AddVMOption -Xmx1024M

to

AddVMOption -Xms256M
AddVMOption -Xmx768M

If this also doesn't start your jDeveloper, change it to 如果这也无法启动您的jDeveloper,请将其更改为

AddVMOption -Xms256M
AddVMOption -Xmx512M

And the same goes with 'jdev.conf' 'jdev.conf'也是如此

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM