*
The moose likes BEA/Weblogic and the fly likes Weblogic OutOfMemory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » BEA/Weblogic
Bookmark "Weblogic OutOfMemory" Watch "Weblogic OutOfMemory" New topic
Author

Weblogic OutOfMemory

Guruprasad Kateel
Greenhorn

Joined: Jul 10, 2003
Posts: 16
Hi,
We are getting the following outofmemory error on the Weblogic 7.0 server:
java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start(Native Method)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2125)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:404)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:344)
at weblogic.jdbc.pool.PreparedStatement.executeQuery(PreparedStatement.java:53)
at com.gm.prm.dataaccess.dao.ActionPlanDAO.getActionPlans(Unknown Source)
at com.gm.prm.service.manager.CAManager.getActionPlans(Unknown Source)
at com.gm.prm.process.web.controller.CAAction.getControlAssessmentPage(Unknown Source)
at com.gm.prm.process.web.controller.CAAction.performAction(Unknown Source)
at com.gm.prm.process.web.controller.PRMAction.perform(Unknown Source)
at org.apache.struts.action.ActionServlet.processActionPerform(ActionServlet.java:1787)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1586)
at com.gm.prm.process.web.controller.PRMServlet.process(Unknown Source)
at com.gm.prm.process.web.controller.PRMServlet.doPost(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1075)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:418)
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:306)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:5533)
at weblogic.security.service.SecurityServiceManager.runAs(SecurityServiceManager.java:685)
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3164)
at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2506)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:234)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:210)



This error occured on the production weblogic application server after the application run continuosly for 2 months. When this exception occured, a huge PL/SQL procedure was running on the database for generating the reports, and this was reducing the response time for the sql queries which was being fired from the application

Software Details:
1) Sun ONE Web Server 6.0 sp5
2) Weblogic 7.0 sp2
3) Oracle v9.2.0
4) Java Servlets 2.3
5) JSP 1.2
6) JDK 1.3.1_08 (Weblogic 7.0 jvm)
7) JDBC 2.0
8) Weblogic Connection Pool, oci thick client

Hardware Details:
1) Web Server:
Sun Solaris 8
2) Application Server:
Sun Solaris 8
3) Database Server:
Sun DS


Configuration:
1) Heap Memory: -Xms56m -Xmx128m
2) No of Servers in the Clustered: 2
3) No of Queue in each server: 1
4) No of thread in default queue: 15

Regards,
Guruprasad
Sunil Trivedi
Greenhorn

Joined: Feb 28, 2004
Posts: 8
If ur appserver have enough free memory u better increase the Heap Size from 56m to 512m, also set the max value to 1024m.

-ms512m -mx1024m

Also u review ur code, specially Oracle connection related issue, like connection may not be closed properly.

If it is a web based application, plz chk how many values u r putting into session, or is there any variable that has more than session or pagecontext scope.

Let me know the status ..once u thru this processes. All the best.

With regards
Sunil
Peter Vennel
Ranch Hand

Joined: Dec 18, 2003
Posts: 46
We are running into this exact same problem. We tried lot of different values for heap size. But it did not work.

Finally I did a thread dump and was surprised that lot of log4j statements are created, which are not recycled.

I even masked the log4j logger statement from my code. But still the threads get created and do not get recycled.

We are using WLS 7.0.4. (tried on Solaris & XP)

Any ideas whats going wrong here...

Thanks

Peter.


Server trace & Thread Dump
Peter Vennel
Ranch Hand

Joined: Dec 18, 2003
Posts: 46
Finally I could resolve the issue.

I am using DOMConfigurator.configureAndWatch() for dynamically reading the log4j xml file. What I noticed was that this was spawning a new thread and this thread was never recycled. I need to look into this later. But for now, I masked theline containing this and everything works fine.

What I would suggest is that take a Thread Dump to see why there are so many threads.
 
 
subject: Weblogic OutOfMemory