• 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

java.lang.OutOfMemory

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I'm working on a major project. Using the my program in a development setting everything works well. Trying to move to the real thing (with alot more empty database columns) I get a java.lang.OutOfMemory error.
Any suggestions on where to look, or what to look for?
Thanks
Robin
 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can try the following.
If its GUI, You can set the swing components to null.
In JDBC, close the result set after query.
 
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
Try calling System.gc(); at regular interval..
close all the resources once you have finished using them and explicitly set object references to null. e.g. if you are using a vector and adding some element to it on the run.. you can help JVM by removing all elements/setting it to null once you are done.
Do all the cleanup in finally block to make sure that it happens irrespective of whether your program faces any exception or not.
JDBC is very costly in memory related issues�so don�t forget to close connection if you are opening in your program.
And even if you still get this exception, try after increasing virtual memory(if using windows) otherwise only increasing RAM will help.
Good Luck.

------------------
Amit Agrawal,
New Delhi, India.
 
I'm not sure if I approve of this interruption. But this tiny ad checks out:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic