• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I had a requirement in my project in which i have to provide data in a file to the other application. Data will come through DB on the basis on the basis of date range. I am using SYBASE db. Record count in databse in 8 lacs.

After fetching the data from SYBASE it gets added to List using my organization's internal api. But when i run this process it gives me below error:




If i am not wrong I am getting this error because process is trying to assign 8 lacs objects into the Arraylist.

Can anybody provide alternative ways in which i perform my logic which can run better without going outofmemory.

Thanks,
Manish
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's going to be hard to tell how you can improve this with no code.
First question is, how many rows are you reading from the db into your List?
Do you need to read them all or can you find a way to stream the results?
Looks like you're using the Spring DB stuff, so that's possibly not so easy to achieve.

You seem to be instantiating an expenseCase object (that should be ExpenseCase), which contains a Vehicle, which itself contains a List of something?
Do you need those?
Can you cut down the size of the object you are building?

Of course, the first thing you probably need to do is find out what exactly is taking up the memory...and for that you need a heap dump and some time analysing it.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic