Eclipse – Java.Lang.OutOfMemoryError: Java Heap Space(转)
In Eclipse IDE, if your program is consuming a lot of memory (loading big data) like this :
List<Domain> list = domainBo.findAllDomain(100000);
for(Domain domain : list){
process(domain.getDomainName());
}
It can easily hit java.lang.OutOfMemoryError: Java heap space :
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.<init>(HashMap.java:209)
at java.util.LinkedHashMap.<init>(LinkedHashMap.java:181)
1. Solution – VM arguments
On Eclipse menu, clicks Run -> Run Configurations.., select the Java application you want to run, clicks on theArguments tab, update the VM arguments with the following options
-Xms<size> - Set initial Java heap size
-Xmx<size> - Set maximum Java heap size
For example, -Xms512M -Xmx1024M

2. Mistake – eclipse.ini
The memory settings in eclipse.ini is allocated to Eclipse IDE only, not the program you want to run. A very common mistake is updated the heap size in eclipse.ini, and expects it to solve above out of memory problem.
The Java application, Ant / Maven build scripts, or unit test cases, are run as an external tool from Eclipse, and it does not inherit the VM settings in eclipse.ini.
But, if your Eclipse IDE is always crashed by no reason, you can try to increase the heap size and perm gen ineclipse.ini.
-startu
openFile
-showsplash
//...
-XX:MaxPermSize=512m
-Xms512m
-Xmx1024m
//...
-Xdock:icon=../Resources/Eclipse.icns
-XstartOnFirstThread
P.S eclipse.ini is located in the Eclipse installation folder.
Eclipse – java.lang.OutOfMemoryError: Java heap space
http://www.mkyong.com/eclipse/eclipse-java-lang-outofmemoryerror-java-heap-space/
Eclipse – Java.Lang.OutOfMemoryError: Java Heap Space(转)的更多相关文章
- eclipse内存溢出报错:java.lang.OutOfMemoryError:Java heap space
今天执行了一个比較大的程序,处理的数据达到126MB数据,将数据导入数据库中,用eclipse 来訪问时候,总是出现java.lang.OutOfMemoryError:Java heap space ...
- eclipse:Tomcat设置jvm,解决java.lang.OutOfMemoryError: Java heap space 堆内存溢出
eclipse 有启动参数里设置jvm大小,因为eclipse运行时自己也需要jvm,所以eclipse.ini里设置的jvm大小不是具体某个程序运行时所用jvm的大小,这和具体程序运行的jvm大小无 ...
- eclipse中报错:java.lang.OutOfMemoryError: Java heap space
问题: 在eclipse中执行java程序.去重100多万的数据,报例如以下错误: java.lang.OutOfMemoryError: Java heap space 异常原因: 在JVM中假设9 ...
- Eclipse迅速执行:Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
问题叙述性说明: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space 问题原因: 程序中对 ...
- eclipse运行程序时报java.lang.OutOfMemoryError: Java heap space内存不足问题
System.setProperty("webdriver.firefox.bin", "D:\\Mozilla Firefox\\firefox.exe"); ...
- 解决eclipse maven install 造成JVM 内存溢出(java.lang.OutOfMemoryError: Java heap space)
maven install 报错信息: The system is out of resources.Consult the following stack trace for details.jav ...
- 【转】java.lang.OutOfMemoryError: Java heap space的解决
原文地址:http://blog.sina.com.cn/s/blog_4b12778b0100v0bb.html Myeclipse下java.lang.OutOfMemoryError: Java ...
- 关于java.lang.OutOfMemoryError: Java heap space的错误分析
今天无意间遇到这个错误:java.lang.OutOfMemoryError: Java heap space 问题出现原因:使用a标签实现快速下载[当然已经实现了,但想了想还是要归纳解决这类问题] ...
- Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space解决方法 问题描述 Exception ...
随机推荐
- dom学习要点
Dom操作 1.文本内容操作 - innerText:操作文本 - innerHtml:操作全内容 //innerText标签: <div id='i2' ><a>土味程序员& ...
- ReLU——Deep Sparse Rectifier Neural Networks
1. 摘要 ReLU 相比 Tanh 能产生相同或者更好的性能,而且能产生真零的稀疏表示,非常适合自然就稀疏的数据. 采用 ReLU 后,在大量的有标签数据下,有没有无监督预训练模型取得的最好效果是一 ...
- Javascript开发者 常用知识
Javascript是一种日益增长的语言,特别是现在ECMAScript规范按照每年的发布时间表发布.伴随着这门语言的规模化和快速发展,掌握JS(不仅仅是jQuery)的重要性,变得更加重要. 这不是 ...
- 王者荣耀交流协会final发布-第一次scrum立会
1.例会照片 成员王超,高远博,冉华,王磊,王玉玲,任思佳,袁玥全部到齐 master:袁玥 2.时间跨度 2017年12月1日 17:00 — 17:31,总计31分钟 3.地点 一食堂二楼沙发座椅 ...
- Data truncation: Truncated incorrect DOUBLE value:
在写sql查询语句queryRunner.update(connection,"update account set balance=? where name=?",account ...
- Daily Srum 10.21
到目前为止,我们组处在学习阶段,很多知识点都还不太清楚,所以现在我们还在看相关书籍和博客,任务. 而我们此间主要是在阅读一些材料: 陈谋一直在看学长的代码,其中C#的很多方式我都不太明白(尽管和Jav ...
- 2-Seventh Scrum Meeting20151207
任务分配 闫昊: 今日完成:完成数据库设计. 明日任务:和唐彬讨论接口如何在android实现. 唐彬: 今日完成:读了IOS讨论区后台接口. 明日任务:和闫昊讨论接口如何在android实现. 史烨 ...
- SQLyog的基本使用
[简介] SQLyog是mysql数据库的客户端软件 [基本使用] 1.连接mysql数据库 2.SQLyog的页面使用介绍 3.基本的数据库命令 1) use命令 切换数据库 2) unsigned ...
- Task 6.3 冲刺Two之站立会议1
今天是二次冲刺的第一天,由于第一阶段已经大概完成了软件的主体功能和框架,我主要看了一下同学们提出的视频和音质的问题,想办法做出了相应的改善.另外我们的功能还是比较单一的,要对主界面进行一定的扩充,所以 ...
- nodeJS + webStrome
一.配置开发环境: 1.先安装node (1).访问http://nodejs.org打开安装包,正常安装,点击next即可. 为了测试是否安装成功,打开命令提示符,输入node,则进入node.js ...