Java.lang.OutOfMemory Java 堆空间 JDeveloper
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3442323/
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
Java.lang.OutOfMemory Java Heap Space JDeveloper
提问by Sami
I am writing an application on Java and it is throwing this error Java.lang.OutOfMemory Java Heap Space JDeveloper
. I know that I can add java -Xmx512m
to the command line to solve the problem. However, I need to run this application on JDeveloper. So, my Question is:
我正在用 Java 编写一个应用程序,它抛出了这个错误Java.lang.OutOfMemory Java Heap Space JDeveloper
。我知道我可以添加java -Xmx512m
到命令行来解决问题。但是,我需要在 JDeveloper 上运行此应用程序。所以,我的问题是:
How to increase the size of the Heap on JDveloper?
如何在 JDveloper 上增加堆的大小?
Thank you, Sami
谢谢你,萨米
采纳答案by KristofMols
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 提供给 JVM 的内存量的文件(相对于jdeveloper/ide/bin/
目录)包括:
- jdev.conf
- ide.conf
- 配置文件
- 配置文件
Update these files as follows:
更新这些文件如下:
- Quit JDeveloper.
- Edit
ide.conf
. - Append the following
AddVMOption -Xms256M AddVMOption -Xmx1024M
- Edit
jdev.conf
. - Find the
AddVMOption
for the "heap size." - Change the values as follows:
AddVMOption -Xmx1024M AddVMOption -XX:MaxPermSize=1024M
- 退出 JDeveloper。
- 编辑
ide.conf
。 - 附加以下内容
AddVMOption -Xms256M AddVMOption -Xmx1024M
- 编辑
jdev.conf
。 - 找到
AddVMOption
“堆大小”的 。 - 更改值如下:
AddVMOption -Xmx1024M AddVMOption -XX:MaxPermSize=1024M
Large Files
大文件
JDeveloper na?vely attempts to parse files having known file extensions that are located in the project's root level directory. A sufficiently large file, such as a 3GB XML file, will cause problems. 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 天真地尝试解析位于项目根级目录中的具有已知文件扩展名的文件。一个足够大的文件,例如 3GB 的 XML 文件,会导致问题。要解决此问题,请为大数据创建一个子目录并将文件移入其中。JDeveloper 不会尝试在任意子目录中查找资源。
回答by Kai Sternad
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。
回答by Soumya R
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' 也是如此