Eclipse Java heap space or java.lang.OutOfMemoryError

Posted: December 16, 2013 in Java Posts, Java Posts, Java Tutorials
Tags: , , ,

Eclipse out of memory

In Eclipse IDE, if your program is consuming a lot of memory (loads huge records) like this : List<Domain> list = domainBo.findAllDomain(100000); for(Domain domain : list){ process(domain.getDomainName()); } It can easily hit java.lang.OutOfMemoryError : 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…

Read More »

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s