This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC and the fly likes OutofMemory Error.. Due to Pooling? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "OutofMemory Error.. Due to Pooling?" Watch "OutofMemory Error.. Due to Pooling?" New topic
Author

OutofMemory Error.. Due to Pooling?

Rajkumar balakrishnan
Ranch Hand

Joined: May 29, 2008
Posts: 445

Hi friends,

We are using JNDI with Struts for DS and Connection Pooling. The issue is we very often getting this 'OutOfMemoryError'. And after a server restart only we can able to use the application. Currently we dont have much data's say around 5000, but after implementation, it'll go upto 1lakh. My question is , is there any way to find if there is an memory leak in the application? Because, for another application we are using Spring + DBCP and it never give us any problem yet.

Or else,do we need to close each and every connection manually in Controller itself? Which one do you suggest and please help me get rid of this.

Thanks in advance.


Never try to be a hard-worker. Be a smart-worker.
My Blog
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You should always release JDBC resources in a finally block after you have finished with them.

To find memory leaks, run your application in a soak test environment and watch memory consumption. If it keeps rising, you may have a leak. To find it, profile what the application is doing with a profiler.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

To find it, profile what the application is doing with a profiler.


Try visualvm


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: OutofMemory Error.. Due to Pooling?
 
Similar Threads
Need Suggestion ? JDBC Connection
object pooling
MySQL connection is dropped before wait_timout is elapsed
Connection Pooling
Issues with Oracle connection/statement when accessing through JDBC