troubleshooting Question

java.lang.OutOfMemoryError: Java heap space for data (retrieved from database) added to arraylist

Avatar of annapolistech
annapolistechFlag for United States of America asked on
JSPMySQL ServerJava EE
12 Comments4 Solutions760 ViewsLast Modified:
I am populating a bean using the data retieved from database by executing a qyery like "SELECT * FROM xyz", where the total rows returned by the query is about 16000. Finally I add the bean to an ArrayList and storing the list in session, a custom tag in another JSP will  scroll through the list to display paginated results.
The problem is, as soon as I add the bean to the arraylist, I am getting a java.lang.OutOfMemoryError: Java heap space exception which in turn is stopping the flow of execution.

Any help in this regard will be appreciated,

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 4 Answers and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 4 Answers and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros