• 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

OutOfMemory in Data Source

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set up a data source to a SQL Server database in WL 10.3.5. I have 2 java programs that use JDBC to query the database every 3 minutes. I close all connections in my java programs using JDBC.

I noticed the Current Active Connection value is pretty high. Leaked connections are 0. After a few days, I've gotta Out Of Memory and I had to restart the server.

I did not make changes to any settings when I set up the data source like Connection Timeout or others? What settings should I change please? And what values should I give them?

Thanks
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Are you using some sort of Connection Pooling? If so are you returning the connection to the pool? When you say you are closing the connection, where are you actually doing it? In the finally block? It would be better if you could post some of your source code. It will be hard for others to guess!
 
Ong Vua
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's my code. These code statements are not in the finally statement. My questions:

1) How do I know if I use a connection pool? Do I have to do anything else to specify that I use the pool in my code?


 
Ranch Hand
Posts: 376
2
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try taking a Heap Dump when OOM is reach, then analyze it with Eclipse MAT.

JDK 1.6 has the following parameters to take a heap dump when OOM:

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic