File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Weblogic OutOfMemory

Guruprasad Kateel

Joined: Jul 10, 2003
Posts: 16
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(
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(
at weblogic.jdbc.pool.PreparedStatement.executeQuery(
at Source)
at Source)
at Source)
at Source)
at Source)
at org.apache.struts.action.ActionServlet.processActionPerform(
at org.apache.struts.action.ActionServlet.process(
at Source)
at Source)
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at weblogic.servlet.internal.ServletStubImpl$
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.ServletStubImpl.invokeServlet(
at weblogic.servlet.internal.WebAppServletContext$
at weblogic.servlet.internal.WebAppServletContext.invokeServlet(
at weblogic.servlet.internal.ServletRequestImpl.execute(
at weblogic.kernel.ExecuteThread.execute(

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

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

Sunil Trivedi

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
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...



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.
I agree. Here's the link:
subject: Weblogic OutOfMemory
It's not a secret anymore!