Memory leak in weblogic 6.0 sp2 oracle 8.1.7 thin driver

Hi,
     I have a simple client that opens a database connection, selects from
a table containing five rows of data (with four columns in each row)
and then closes all connections. On running this in a loop, I get the
following error after some time:
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
<OutOfMemoryError in
Adapter
java.lang.OutOfMemoryError
<<no stack trace available>>
>
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
failed
java.lang.OutOfMemoryError
I am running with a heap size of 64 Mb. The java command that runs
the client is:
java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
-Djava.naming.f
actory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=
t3://garlic:7001 -verbose:gc Test
The following is the client code that opens the db connection and does
the select:
import java.util.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class Test {
private static final String strQuery = "SELECT * from tblPromotion";
public static void main(String argv[])
throws Exception
String ctxFactory     = System.getProperty
("java.naming.factory.initial");
String providerUrl     = System.getProperty
("java.naming.provider.url");
Properties jndiEnv          = System.getProperties ();
System.out.println ("ctxFactory : " + ctxFactory);
System.out.println ("ProviderURL : " + providerUrl);
Context ctx     = new InitialContext (jndiEnv);
for (int i=0; i <1000000; i++)
System.out.println("Running query for the "+i+" time");
Connection con = null;
Statement stmnt = null;
ResultSet rs     = null;
try
DataSource ds     = (DataSource) ctx.lookup
(System.getProperty("eaMDataStore", "jdbc/eaMarket"));
con = ds.getConnection ();
stmnt = con.createStatement();
rs = stmnt.executeQuery(strQuery);
while (rs.next ())
//System.out.print(".");
//System.out.println(".");
ds = null;
catch (java.sql.SQLException sqle)
System.out.println("SQL Exception : "+sqle.getMessage());
finally
try {
rs.close ();
rs = null;
//System.out.println("closed result set");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
stmnt.close ();
stmnt = null;
//System.out.println("closed statement");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
con.close();
con = null;
//System.out.println("closed connection");
} catch (Exception e) {
System.out.println("Exception closing connection");
I am using the Oracle 8.1.7 thin driver. Please let me know if this
memory leak is a known issue or if its something I am doing.
thanks,
rudy

Repost in JDBC section ... very serious issue but it may be due to Oracle or
to WL ... does it happen if you test inside WL itself?
How many iterations does it take to blow? How long? Does changing to a
different driver (maybe Cloudscape) have the same result?
Peace,
Cameron Purdy
Tangosol Inc.
<< Tangosol Server: How Weblogic applications are customized >>
<< Download now from http://www.tangosol.com/download.jsp >>
"R.C." <[email protected]> wrote in message
news:[email protected]...
Hi,
I have a simple client that opens a database connection, selects from
a table containing five rows of data (with four columns in each row)
and then closes all connections. On running this in a loop, I get the
following error after some time:
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Adapter>
<OutOfMemoryError in
Adapter
java.lang.OutOfMemoryError
<<no stack trace available>>
>
<Nov 28, 2001 5:57:40 PM GMT+06:00> <Error> <Kernel> <ExecuteRequest
failed
java.lang.OutOfMemoryError
I am running with a heap size of 64 Mb. The java command that runs
the client is:
java -ms64m -mx64m -cp .:/opt/bea/wlserver6.0/lib/weblogic.jar
-Djava.naming.f
actory.initial=weblogic.jndi.WLInitialContextFactory
-Djava.naming.provider.url=
t3://garlic:7001 -verbose:gc Test
The following is the client code that opens the db connection and does
the select:
import java.util.*;
import java.sql.*;
import javax.naming.*;
import javax.sql.*;
public class Test {
private static final String strQuery = "SELECT * from tblPromotion";
public static void main(String argv[])
throws Exception
String ctxFactory = System.getProperty
("java.naming.factory.initial");
String providerUrl = System.getProperty
("java.naming.provider.url");
Properties jndiEnv = System.getProperties ();
System.out.println ("ctxFactory : " + ctxFactory);
System.out.println ("ProviderURL : " + providerUrl);
Context ctx = new InitialContext (jndiEnv);
for (int i=0; i <1000000; i++)
System.out.println("Running query for the "+i+" time");
Connection con = null;
Statement stmnt = null;
ResultSet rs = null;
try
DataSource ds = (DataSource) ctx.lookup
(System.getProperty("eaMDataStore", "jdbc/eaMarket"));
con = ds.getConnection ();
stmnt = con.createStatement();
rs = stmnt.executeQuery(strQuery);
while (rs.next ())
//System.out.print(".");
//System.out.println(".");
ds = null;
catch (java.sql.SQLException sqle)
System.out.println("SQL Exception : "+sqle.getMessage());
finally
try {
rs.close ();
rs = null;
//System.out.println("closed result set");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
stmnt.close ();
stmnt = null;
//System.out.println("closed statement");
} catch (Exception e) {
System.out.println("Exception closing result set");
try {
con.close();
con = null;
//System.out.println("closed connection");
} catch (Exception e) {
System.out.println("Exception closing connection");
I am using the Oracle 8.1.7 thin driver. Please let me know if this
memory leak is a known issue or if its something I am doing.
thanks,
rudy

Similar Messages

  • WebLogic 5.1.0 & Oracle 8.1.7 thin driver for jdk 1.3.1

    We're currently using Oracle 8.1.6, and need to upgrade to 8.1.7.
    Platform: Solaris 2.6
    WebLogic: 5.1 Service Pack 9
    JDK : 1.3.1
    Regarding the thin drivers, my understanding is that w/ 8.1.7, we can use either
    8.1.7 OR 9.0.1 thin drivers. Has anyone seen issues using either thin driver
    w/ Oracle 8.1.7 and WebLogic?
    Thanks in advance!
    -Chad Baker

    Regarding the thin drivers, my understanding is that w/ 8.1.7, we can use either
    8.1.7 OR 9.0.1 thin drivers. Has anyone seen issues using either thin driver
    w/ Oracle 8.1.7 and WebLogic?Chad,
    We've used both thin drivers successfully under WebLogic 5.1, and
    have been using the 9.0.1 thin driver under Weblogic 6.1 without any
    problems. We moved to the 9.0.1 driver because it's the first driver
    version to implement
    PreparedStatement.setTimestamp(Timestamp,Calendar).
    Recently, we started looking at using JMS and may need to use
    distributed
    transactions, and we're concerned about transaction support in the
    thin
    driver. Various WebLogic docs, like
    http://e-docs.bea.com/wls/docs61///notes/issues.html#1048698, mention
    that 8.1.7 has XA threading issues that cause problems in distributed
    transactions. In one place, they mention that they may have a
    workaround, but it's unclear what the status of that is. And it looks
    like they definitely haven't gotten to testing
    the 9.0.1 driver. If you're interested in distributed transactions,
    you might want to investigate that first.
    Jim

  • Problems storing CLOBs with build-in Oracle 8.1.6 thin driver of WebLogic 6.0 SP2

    Hi,
    I'm using the build-in Oracle 8.1.6 thin driver that comes with
    weblogic.jar of WebLogic 6.0 SP2. It doesn't store CLOBs. Here I have
    to use the class weblogic.jdbc.common.OracleClob. Why?
    WebLogic 5.1 SP 9 + Oracle 8.1.6 thin driver (external) does. Here I
    use the class oracle.sql.CLOB.
    Must I use a OCI driver?
    Thanks,
    Juergen

    I'd also recommend to switch to 8.1.7 thin driver. It's more stable.
    Regards,
    Slava Imeshev
    "NhaBep" <[email protected]> wrote in message
    news:3b71bbcf$[email protected]..
    >
    You can use thin driver to persist CLOB. One thing you must be sure to setautocommit
    to false. Hope this help.
    [email protected] (Juergen) wrote:
    Hi,
    I'm using the build-in Oracle 8.1.6 thin driver that comes with
    weblogic.jar of WebLogic 6.0 SP2. It doesn't store CLOBs. Here I have
    to use the class weblogic.jdbc.common.OracleClob. Why?
    WebLogic 5.1 SP 9 + Oracle 8.1.6 thin driver (external) does. Here I
    use the class oracle.sql.CLOB.
    Must I use a OCI driver?
    Thanks,
    Juergen

  • Oracle 8.1.7 Thin Driver Resultsets

    A simple question I hope.
    We are using the Oracle 8.1.7 thin driver to connect Weblogic 6.0sp2 to an Oracle
    8 db. My question is regarding how the resultset is passed to the server. Is
    there cacheing? If so, is the cache recycled..i.e. for a 1000 row set are rows
    fed to the server 100 at a time? Or is the entire resultset passed at once.
    A general description of this transation or pointers to documentation would be
    greatly appreciated. Thanks for your consideration,
    Jason

    Jason Carter wrote:
    A simple question I hope.
    We are using the Oracle 8.1.7 thin driver to connect Weblogic 6.0sp2 to an Oracle
    8 db. My question is regarding how the resultset is passed to the server. Is
    there cacheing? If so, is the cache recycled..i.e. for a 1000 row set are rows
    fed to the server 100 at a time? Or is the entire resultset passed at once.
    A general description of this transation or pointers to documentation would be
    greatly appreciated. Thanks for your consideration,
    JasonHi. This is entirely an oracle DBMS and driver question. From what I can glean from
    oracle documentation, there is a settable driver property which sets how many rows
    the driver gets in one request. This implies the DBMS and driver will cooperate to
    get a given result set in chunks.
    Joe

  • Memory Leak with Weblogic 6.1

    Hello everyone.
    I need some help with a problem we are having with our application. It consists on Servlets, JMS with MDBs, Xml parsing...
    Our application dequeues messages from an Oracle Queue and sends xml-text message to a servlet. It also receives xml-text and enqueues objects in an Oracle Queue.
    And it also has access to Oracle Database (context tables, etc).
    We are doing everything on Tru64 Unix (and our tests on Win 2000) and we are using WebLogic 6.1.
    Our problem is that we have found that it seems that the garbage collector is not running well. I mean, with the time our system is degrading. The memory use increases. It seems to be a memory leak.
    We have used a testing tool, OptimizeIt, and we have found that there are
    objects that are increasing the use of memory. If we use the option 'java -verbose' we find that it seems to be Hash objects (HashMap, Hashtable) which are increasing the use of memory. In our code we are not using any hashtable nor any class that extends from it (we have deleted everyone).
    Can it be due to a problem with WebLogic? A problem with JMS, queues, etc? A problem with JNDI?
    Could anybody please help us?
    Thanks in advanced.

    Yes, we see that there are some entries of the type:
    java/util/Hahstable$Entry
    java/util/Hahstable
    weblogic/jndi/Environment
    This entries keep growing and growing with the time.
    We have deleted all the Hashtable, Properties and all the kind of Collection objects. I guess WebLogic is using this objects in order to arrange our application runs.
    Am I right? Do you know if we can do anything?
    Thank you.

  • ADO memory leak when getting Recordset from an Oracle stored procedure?

    I am programming in C++ (VC 6) and using ADO 2.7 to
    access Oracle 9i database. My connection string looks
    like this:
    Provider=MSDAORA.1;Persist Security Info=True;User ID=scott;Password=tiger;Data Source=blahblah
    I have Oracle stored procedure that returns data in a
    REF CURSOR output parameter. Since the stored procedure
    takes input parameters, I prepare a Command object with
    Parameters initialized and attached to it. I use the
    Recordset Open method to execute the call. This approach
    works because I get correct data back from the call in
    the Recordset, but the problem is when I do this in a
    infinite loop and watch the process in Windows Taks
    Manager, I see 4k or 8k memory delta all the time and
    the Peak Memory Usage of the process keeping going up.
    I hope someone knows something in this scenario and points
    me to the right direction.
    Thanks, please see the following code for specifics.
    HRESULT CallSP3Params(VARIANT vp1, VARIANT vp2, int spretcode, LPDISPATCH ppRSet, char *pCmdLine)
         _RecordsetPtr     pRs;
         _CommandPtr     pCmd;
         _ParameterPtr     paramVProfiler[3];
         bstrt          strMissing(L"");
         *ppRSet = NULL;
         variantt          ErrConn;
         ErrConn.vt = VT_ERROR;
         ErrConn.scode = DISP_E_PARAMNOTFOUND;
         try {
         //Create instance of command object
         pCmd.CreateInstance(__uuidof(Command));
         pRs.CreateInstance(__uuidof(Recordset));
              if ( vp1.vt == VT_BSTR ) {
                   paramVProfiler[0] = pCmd->CreateParameter("P1",adVarChar,adParamInput,SysStringLen(vp1.bstrVal) + 10,strMissing );
                   paramVProfiler[0]->Value = vp1;
              else if ( vp1.vt == VT_I4 )
                   paramVProfiler[0] = pCmd->CreateParameter("P1",adNumeric,adParamInput,15,vp1);
              else
                   TESTHR( PARAMETER_OPERATION_ERROR );
              pCmd->Parameters->Append(paramVProfiler[0]);
              if ( vp2.vt == VT_BSTR ) {
                   paramVProfiler[1] = pCmd->CreateParameter("P2",adVarChar,adParamInput,SysStringLen(vp2.bstrVal) + 10,strMissing );
                   paramVProfiler[1]->Value = vp2;
              else if ( vp2.vt == VT_I4 )
                   paramVProfiler[1] = pCmd->CreateParameter("P2",adNumeric,adParamInput,15,vp2);
              else
                   TESTHR( PARAMETER_OPERATION_ERROR );
              pCmd->Parameters->Append(paramVProfiler[1]);
              paramVProfiler[2] = pCmd->CreateParameter("RETCODE",adNumeric,adParamOutput,10);
              pCmd->Parameters->Append(paramVProfiler[2]);
         //Catch COM errors
         catch( comerror &e) {
         try {
         // I manage my connection through this little C++ class of my own
         CCUsage myconnection( &Connectionkeeper[0] );
         //Set the active connection property of command object to open connection
         pCmd->ActiveConnection = myconnection.m_conn;
         //The command type is text
         pCmd->CommandType = adCmdText;
         //Set command text to call the stored procedure
         pCmd->CommandText = pCmdLine;
         //Open the Recordset to get result
         pRs->Open( variantt((IDispatch *)pCmd,true), ErrConn, adOpenStatic, adLockReadOnly, adOptionUnspecified );
         //Disconnect the command object
         pCmd->PutRefActiveConnection( NULL );
         if ( GetSPRetCode( pCmd, "RETCODE", spretcode ) != S_OK )
              TESTHR(DB_OBJECT_OPERATION_ERROR);
         // pRs->QueryInterface(IID_IDispatch, (void**) ppRSet);
         // I return the Recordset by calling QueryInterface, but even without that, closing the Recordset right here still shows memory leak.
         pRs->Close( );
         pRs = NULL;
         //Catch COM errors
    catch (_com_error e) {
         return S_OK;
    }

    Whenever large numbers of BSTRs are allocated and freed quickly the process memory will continue to climb towards a stabalizing value. BSTRs are not freed until the system frees them. You can see this by making many calls allocating and freeing BSTRs, memory will climb, but when you stop for a while the gargage collection of the sys strings will take place. I've done much research to see that a server doing many queries very rapidly is not leaking memory, but out pacing the garbage collection, it will stabilize and when the process has some "rest time" the processes memory usage will decline.
    In my research a suspected memory leak was not one.

  • Memory Leak w/ WebLogic 5.1

    I've created a simple servlet to EJB skeleton and built a stress testing
              tool to make sequential requests to the servlet which in turn creates an
              instance of a stateless session been. Both the servlet and bean do not have
              any real logic in them, just some minimal timing output.
              When run for a few million iterations, the WebLogic JVM slowly leaks memory
              that cannot be reclaimed even with force garbage collection from the
              WebLogic console. Below are 3 snippets of code showing the servlet, the EJB
              call, and the simple client test.
              If anyone else is ecperiencing similar problems or can see a flaw, I'd be
              most grateful.
              Andy
              Servlet code
              protected void doGet(HttpServletRequest req, HttpServletResponse res)
              throws ServletException, IOException
              TestBean bean;
              long requestStartTime = System.currentTimeMillis();
              res.setContentType("text/html");
              PrintWriter out = res.getWriter();
              out.println("<html><head><title>Hello World!</title></head>");
              out.println("<body><h1>Hello World!</h1></body></html>");
              try {
              bean = home.create();;
              bean.testMethod();
              catch (Exception e) {
              totalTime += (System.currentTimeMillis() - requestStartTime);
              Bean code
              public class TestBean implements SessionBean {
              private SessionContext ctx;
              public void ejbActivate() {
              public void ejbPassivate() {
              public void ejbCreate() {
              public void ejbRemove() {
              public void setSessionContext(SessionContext ctx) {
              this.ctx = ctx;
              public void testMethod() {
              Client code
              public void simulateLoad()
              throws IOException
              long totalRequestTime = 0, requestTime, requestStartTime;
              long totalResponseTime = 0, responseTime, responseStartTime;
              try {
              log("Opening connection to "+ url + (debug ? "?debug=true" : ""));
              for (int i = 1; i <= numRequests; i++) {
              HTTPConnection con = new HTTPConnection("localhost",7001);
              HTTPResponse rsp;
              byte data[];
              if ((i % 10000) == 0) {
              log("\nGET Request "+i+" to "+ url + (debug ? "?debug=true" :
              requestStartTime = System.currentTimeMillis();
              rsp = con.Get("/mcumanager" + (debug ? "?debug=true" : ""));
              requestTime = System.currentTimeMillis() - requestStartTime;
              responseStartTime = System.currentTimeMillis();
              if (rsp.getStatusCode() >= 300) {
              log("Received Error: "+rsp.getReasonLine());
              log(new String(rsp.getData()));
              else
              data = rsp.getData();
              responseTime = System.currentTimeMillis() - responseStartTime;
              totalRequestTime += requestTime;
              totalResponseTime += responseTime;
              if ((i % 10000) == 0) {
              log("GET Response "+i+": "+rsp);
              if ((i % 100) == 0) {
              log ("Avg request time :
              "+((float)totalRequestTime/(float)i)+"ms");
              log ("Avg response time :
              "+((float)totalResponseTime/(float)i)+"ms");
              catch (IOException ioe) {
              log(ioe.toString());
              ioe.printStackTrace();
              catch (ModuleException me) {
              log("Error handling request: " + me.getMessage());
              me.printStackTrace();
              

    Please read discussion "WLS dies during stress testing" & "performance
              degradation PROBLEM" in interest.performance.
              Hope it helps.
              Cheers - Wei
              Andy Riedel <[email protected]> wrote in message
              news:[email protected]...
              > I have additional information on this problem. I have replicated the exact
              > same memory leak issue using the included HelloWorldServlet. I use Jrun's
              > ServletKiller stress tool running 16 simultaneous request threads
              requesting
              > the HelloWorldServlet. This WebLogic 5.1 server will leak memory and
              > eventually run out of memory all together with an OutOfMemoryException
              after
              > about 6-8 hours. This indicates that the bug is in the base HTTP Servlet
              > engine code.
              >
              > I have tried turning off the http log (i.e. access.log) as well as
              > notification events from the servlet engine and it still leaks memory.
              >
              > Andy
              >
              >
              >
              > Andy Riedel Chief Architect HearMe Call me through VoiceCONTACTtm -- right
              > from your computer. Online Status:
              > "Andy Riedel" <[email protected]> wrote in message
              > news:[email protected]...
              > > I've created a simple servlet to EJB skeleton and built a stress testing
              > > tool to make sequential requests to the servlet which in turn creates an
              > > instance of a stateless session been. Both the servlet and bean do not
              > have
              > > any real logic in them, just some minimal timing output.
              > >
              > > When run for a few million iterations, the WebLogic JVM slowly leaks
              > memory
              > > that cannot be reclaimed even with force garbage collection from the
              > > WebLogic console. Below are 3 snippets of code showing the servlet, the
              > EJB
              > > call, and the simple client test.
              > >
              > > If anyone else is ecperiencing similar problems or can see a flaw, I'd
              be
              > > most grateful.
              > >
              > > Andy
              > >
              > >
              > > Servlet code
              > > -------------
              > >
              > > protected void doGet(HttpServletRequest req, HttpServletResponse res)
              > > throws ServletException, IOException
              > > {
              > > TestBean bean;
              > >
              > > long requestStartTime = System.currentTimeMillis();
              > >
              > > res.setContentType("text/html");
              > > PrintWriter out = res.getWriter();
              > > out.println("<html><head><title>Hello World!</title></head>");
              > > out.println("<body><h1>Hello World!</h1></body></html>");
              > >
              > > try {
              > > bean = home.create();;
              > > bean.testMethod();
              > > }
              > > catch (Exception e) {
              > > }
              > >
              > > totalTime += (System.currentTimeMillis() - requestStartTime);
              > > }
              > >
              > > Bean code
              > > -----------
              > > public class TestBean implements SessionBean {
              > >
              > > private SessionContext ctx;
              > >
              > > public void ejbActivate() {
              > > }
              > >
              > > public void ejbPassivate() {
              > > }
              > >
              > > public void ejbCreate() {
              > > }
              > >
              > > public void ejbRemove() {
              > > }
              > >
              > > public void setSessionContext(SessionContext ctx) {
              > > this.ctx = ctx;
              > > }
              > >
              > > public void testMethod() {
              > > }
              > > }
              > >
              > > Client code
              > > ------------
              > > public void simulateLoad()
              > > throws IOException
              > > {
              > > long totalRequestTime = 0, requestTime, requestStartTime;
              > > long totalResponseTime = 0, responseTime, responseStartTime;
              > >
              > > try {
              > > log("Opening connection to "+ url + (debug ? "?debug=true" : ""));
              > >
              > > for (int i = 1; i <= numRequests; i++) {
              > >
              > > HTTPConnection con = new HTTPConnection("localhost",7001);
              > > HTTPResponse rsp;
              > > byte data[];
              > >
              > > if ((i % 10000) == 0) {
              > > log("\nGET Request "+i+" to "+ url + (debug ? "?debug=true" :
              > > ""));
              > > }
              > >
              > > requestStartTime = System.currentTimeMillis();
              > >
              > > rsp = con.Get("/mcumanager" + (debug ? "?debug=true" : ""));
              > >
              > > requestTime = System.currentTimeMillis() - requestStartTime;
              > >
              > > responseStartTime = System.currentTimeMillis();
              > >
              > > if (rsp.getStatusCode() >= 300) {
              > > log("Received Error: "+rsp.getReasonLine());
              > > log(new String(rsp.getData()));
              > > }
              > > else
              > > data = rsp.getData();
              > >
              > > responseTime = System.currentTimeMillis() - responseStartTime;
              > >
              > > totalRequestTime += requestTime;
              > > totalResponseTime += responseTime;
              > >
              > > if ((i % 10000) == 0) {
              > > log("GET Response "+i+": "+rsp);
              > > }
              > >
              > > if ((i % 100) == 0) {
              > > log ("Avg request time :
              > > "+((float)totalRequestTime/(float)i)+"ms");
              > > log ("Avg response time :
              > > "+((float)totalResponseTime/(float)i)+"ms");
              > > }
              > > }
              > > }
              > > catch (IOException ioe) {
              > > log(ioe.toString());
              > > ioe.printStackTrace();
              > > }
              > > catch (ModuleException me) {
              > > log("Error handling request: " + me.getMessage());
              > > me.printStackTrace();
              > > }
              > > }
              > >
              > >
              > >
              > >
              > >
              >
              >
              

  • ThreadLocalObject memory leak detected (Weblogic 8 SP6)

    It seems that our application server (which heavily uses Entity and Stateless session beans) constantly creates weblogic.ejb20.internal.BaseEJBObject,ThreadLocalObject's in memory. These objects keep increasing and never go down.
    In a typical 90 hr run we create upto 22,000,000 instances of these objects. Could someone explain what these are used for and how to fix this issue.

    Before you assume you have a memory leak, go to the "Monitoring"->"Performance" page of your server config. Set the page to auto-refresh (I think you can do that in 8.1). While your application is doing its work continuously, every 30 seconds or so, push the "garbage collect" button and watch the "percent free" amount immediately after the GC completes. Keep track of that number. If that number (the one after the GC completes) is continuously going down, and eventually causes an OutOfMemory error, then you have a memory leak. If not, then you probably don't.

  • Possible Memory Leak, many instances of macromedia.jdbc.oracle.OracleConnection, serviceFactory

    I'm using a plug-in for Eclipse to help identify possible memory leaks however we are having trouble interpreting the results.  The top, and pretty much the only, suspect is this...
    7,874 instances of "macromedia.jdbc.oracle.OracleConnection", loaded by "coldfusion.bootstrap.BootstrapClassLoader @ 0xf935218" occupy 604,781,904 (71.02%) bytes. These instances are referenced from one instance of "java.util.HashMap$Entry[]", loaded by "<system class loader>"
    Any ideas what could cause this many instances?  How do we track this back to a particular cfm or cfc?  Do these number seem high or is that normal?  The system in question normally only has 30-60 concurrent users.
    The one item I'm a little skeptical of is the use of the "coldfusion.server.ServiceFactory" and "coldfusion.sql.QueryTable" objects.  We use them for 1000s of different queries, even queries within large loops.  Could these be the problem?  Each time we need to execute a query we do a createObject for each of these objects, when done we close the connection.  I recently found a similar example where they close the recordSet first and then close the connection, we are not closing the recordSet.  Any help at all is much appreciated.

    It could simply be caused by the obvious: a query or queries making a large number of connections and/or consuming large resources on the Oracle database. Use Eclipse to search your application folder for queries. Can you identify any queries that could be the culprit? Is there a loop containing a method or an instance of a component that queries an Oracle database?
    What's your Coldfusion  version? If you're on CF8 or CF9 then the server monitor (in the Coldfusion Administrator) might tell you the process responsible for the high consumption.

  • Possible memory leak in Weblogic 7.0

    We have developed an EJB application on Weblogic 7.0 running on HP-UX 11.0. Some
    JSP/Javabean programs, that lookup EJB compoments for services, are developed
    on the Resin web server to serve browser requests. Both Resin and Weblogic are
    running on the same HP machine. JDK version is 1.3.1_06 for HP-UX.
    The real memory is 2GB. Tha parameters to start Resin server are
    -showversion -verbose:gc -Xms384m -Xmx384m -Xoptimize
    The parameters to startup Weblogic are in the following:
    -server -showversion -verbose:gc -Xms768m -Xmx768m -XX:NewSize=256m -XX:SurvivorRatio=6
    -Xoptimize -XdoCloseWithReadPending
    In our observations, the peak traffic is during the working hours. Only few users
    (less than 40 users) stay in our system in the night and holidays.
    And in our observations, the weblogic will do the GC if necessary. But some memory
    are lost after each GC even not in the peak time. Thus, after running two or three
    days, there are only lillte free memory for use, and the Weblogic begins to take
    much time (10-30 seconds ) doing GC more often and often. At last, an OutOfMemory
    error generated.
    I hope that Weglogic can serve all the time.
    Does anybody han as experience on this problem?

    Thanks for your kinfness.
    We have wrote some single-user applications to test the Weblogic 7.0. We doubt
    it is JDBC driver's problem.
    We downloaded the Informix JDBC driver 2.21_JC2 to replace the older version 2.20_JC1
    and retest our applications. The memory usage curve looks much better and the
    applications run over three days.
    We will continue to observe the execution. Maybe the JDBC driver is the real problem.
    "Aravind Krishnasamy" <[email protected]> wrote:
    I am not sure whether it's an application problem or application server
    problem. Both are possible. I am not familar with HP Java Version.
    It may be a problem due to loitering object. You can try doing testing
    with
    single user and the memory needs for the user.
    NoteThe memory level before the test and after the test
    Foce GC and you need to GC same level of HEAP Used, Profiling tools will
    be
    helpful to find application problem
    Aravind
    "Wen-Hung Yeh" <[email protected]> wrote in message
    news:[email protected]...
    We have developed an EJB application on Weblogic 7.0 running on HP-UX11.0. Some
    JSP/Javabean programs, that lookup EJB compoments for services, aredeveloped
    on the Resin web server to serve browser requests. Both Resin and Weblogicare
    running on the same HP machine. JDK version is 1.3.1_06 for HP-UX.
    The real memory is 2GB. Tha parameters to start Resin server are
    -showversion -verbose:gc -Xms384m -Xmx384m -Xoptimize
    The parameters to startup Weblogic are in the following:
    -server -showversion -verbose:gc -Xms768m -Xmx768m -XX:NewSize=256m-XX:Su
    rvivorRatio=6
    -Xoptimize -XdoCloseWithReadPending
    In our observations, the peak traffic is during the working hours.Only
    few users
    (less than 40 users) stay in our system in the night and holidays.
    And in our observations, the weblogic will do the GC if necessary.But
    some memory
    are lost after each GC even not in the peak time. Thus, after runningtwo
    or three
    days, there are only lillte free memory for use, and the Weblogic beginsto take
    much time (10-30 seconds ) doing GC more often and often. At last,an
    OutOfMemory
    error generated.
    I hope that Weglogic can serve all the time.
    Does anybody han as experience on this problem?

  • Compatability of oracle 8i/9i to thin driver

    Hi,
    I am new to JDBC. will you please tell me whether Oracle 8i / 9i is compatable to use JDBC thin driver.
    If so, what is the SID name i need to give. Let's say i have installed oracle 9i on my machine. and set the class path to "classes12.jar". where i need to create SID name. what SID name i need to give there.
    If i am using JDBC 2nd driver :
    con = DriverManager.getConnection ("jdbc:oracle:oci8:@orcl", "scott", "tiger");
    what i need to give at "oci8" and "orcl".... or these are required to be give as it is..?
    though it's a simple question please answer my question.

    jdbc:oracle:thin:@youmachinename:1521:myDbSID
    here after @ mention your database url , 1521 is default port number and after port number mention your SID

  • How can I do "2PC"  WLS6.0 + oracle 8.1.6 (thin driver )

     

    Access oracle db by sys user and execute initjvm.sql and initxa.sql.
    And then grant "select" priviledge on dba_pending_transactions to users that you
    want to use to make dbpool.
    "jongho cha" <[email protected]> wrote:
    >
    Hi gurus ^^
    I'm trying to do two phase commit with wls6.0 and oracle 8.1.6.
    and I used oracle thin driver ( supports jdbc2.0 )
    part from my config.xml --
    <JDBCTxDataSource EnableTwoPhaseCommit="true"
    JNDIName="testTXDataSource" Name="testTXDataSource"
    PoolName="testPool" Targets="myserver"/>
    <JDBCConnectionPool CapacityIncrement="2"
    DriverName="oracle.jdbc.xa.client.OracleXADataSource"
    InitialCapacity="1"
    LoginDelaySeconds="0"
    MaxCapacity="10"
    Name="testPool" Properties="user=uskeic;password=dba;url=jdbc:oracle:thin:@remote_oracle_db_ip:1521:dbname;dataSourceName=testPool"
    ShrinkPeriodMinutes="15" ShrinkingEnabled="false"
    Targets="myserver" TestConnectionsOnReserve="true"
    TestTableName="dual" URL="jdbc:oracle:thin:@remote_oracle_db_ip:1521:dbname"/>
    is it right configuration ?
    basically , it looks like there's no problem when the WLS starts.
    but if I get Conncetion from txDatasource and createStatement from the
    connection
    , I got some Exception
    it tells like ..
    java.sql.SQLException: ORA-06550: column 1, row14:PLS-00201: 'JAVA_XA.XA_START'
    specifier must be defined
    ORA-06550: column 1, row8:PL/SQL: Statement ignored
    and blah blah blah...
    my code starts here ,,
    Connection con = null ;
    XAConnection xaCon = null ;
    Statement stmt = null ;
    UserTransaction tx = (UserTransaction)ctx.lookup("javax.transaction.UserTransaction");
    tx.begin();
    Context jndiContext = JNDIService.getInitialContext();
    XADataSource xaDataSource = (XADataSource)jndiContext.lookup( txDataSourceName
    xaCon = xaDataSource .getXAConnection();
    con = xaCon.getConnection(); // OK so far
    stmt = con.createStatement() ; // Error HERE !!!
    // ..... and do another DB works for testing 2PC
    tx.commit();
    you know, it's not a complete code . actually , it's like a psuedo code
    but the way of getting connection and create statement follows my entire
    code.
    Can any one help me ? ^^;
    Thanks in advance .

  • Oracle server side jdbc thin driver throws ORA-01017

    We upgraded our database to 11.2.0.1 from 9.2.0.6.
    When we try to connect to an external database from Oracle JVM using server side jdbc thin driver, it throws invalid user id/password error.
    The below test code simulates the issue and is not working on the upgraded instance. The same code is working in fine in other 11.2.0.1 instances. It worked fine before upgrade. In all cases, we are connecting to the same target database instance which is also in 11.2.0.1. It fails only on this database.
    SEC_CASE_SENSITIVE_LOGON is set to false.
    Any inputs will be highly appreciated.
    Code:_
    create or replace and compile java source named TestConn as
    import java.sql.SQLException;
    import oracle.jdbc.OracleDriver;
    import oracle.jdbc.OracleConnection;
    import java.sql.DriverManager;
    public class TestConn {
         public  static String runTest() {
          String msg = "Start";
          OracleConnection tempOC = null;
          try {
          String pUrl = "jdbc:oracle:thin:@dev:1521:dev";
          String pUser = "tst_user";
          String pPwd = "dummy";
          DriverManager.registerDriver (new oracle.jdbc.OracleDriver());
          tempOC = (OracleConnection)DriverManager.getConnection(pUrl, pUser, pPwd);
    msg = "Success";
    } catch (SQLException sqle) {
          System.out.println(sqle.toString());
          sqle.printStackTrace();
          msg = "Failure";
            return msg;
    CREATE OR REPLACE FUNCTION test_conn RETURN VARCHAR2
    AS LANGUAGE JAVA
    NAME 'TestConn.runTest() return java.lang.String';
    set serverout on
    declare
    c varchar2(4000);
    begin
    dbms_java.set_output(5000);
    c:=test_conn();
    dbms_output.put_line(c);
    end;
    / Error Message_
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied
    java.sql.SQLException: ORA-01017: invalid username/password; logon denied
           at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
           at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:388)
           at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:381)
           at oracle.jdbc.driver.T4CTTIfun.processError(T4CTTIfun.java:564)
           at oracle.jdbc.driver.T4CTTIoauthenticate.processError(T4CTTIoauthenticate.java:431)
           at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
           at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
           at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java:366)
           at oracle.jdbc.driver.T4CTTIoauthenticate.doOAUTH(T4CTTIoauthenticate.java)
           at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:359)
           at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java)
           at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
           at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
           at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java)
           at java.sql.DriverManager.getConnection(DriverManager.java)
           at java.sql.DriverManager.getConnection(DriverManager.java)
           at TestConn.runTest(TESTCONN:22) Edited by: sskumar on Mar 6, 2011 1:12 PM

    At the time our issue was resolved, the bug was not published. And, I was told, there was no information in metalink about the isue. I am not sure whether they published some thing in the last few weeks.
    This is what resolved our issue.
    Step 1: alter system set java_jit_enabled=FALSE;
    Step 2: Try your test case. If it is the same issue as ours, your test case will be successful. If it succeeds, Go to step 3. If it does not succeed, it is a different issue.
    Step 3: alter system set java_jit_enabled=TRUE;
    Step 4: Run your test case. If it is the same issue, it is expected to fail. Go to Step 5 in case of failure.
    Step 5: Delete all rows from table java$mc$
    Step 6: Restart the database
    Step 7: Run your test case. It is expected to be successful.

  • Oracle proxy authetication and thin driver

    Hello,
    I am using 10g, and bea 81 sp3, I am trying to setup proxy authetication. All the references I find for proxy authetication are using OCI driver. Is proxy authetication supported using oracle 10g thin driver (ojdbc14.jar)? Can anyone tell me, what drivers are support proxy authetication under oracle 10g?
    Also application servers like bea will not give you oracledata source if you use bea to setup oracle connection pool, is there a easy work around that?
    appreciate,
    Shailesh

    Replace this line:
    DriverManager.registerDriver(new racle.jdbc.OracleDriver());with this one:
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

  • Problem with oracle 9i personal and thin driver

    hi all,
    this is the code i test the connection of thin driver and oracle 9i personal database.
    but i got the error below, could someone tell me where i did wrong.
    thank you...
    import java.sql.*;
    import java.math.*;
    import java.io.*;
    import java.awt.*;
    import oracle.jdbc.driver.*;
    class JdbcTest
      public static void main(String arg[])
        try
          // load oracle driver
          DriverManager.registerDriver(new oracle.jdbc.OracleDriver());
          //connect to the local database
          Connection connection = DriverManager.getConnection
                                 ("jdbc:oracle:thin:@myhost:1521:ORCL","scott","tiger");
          Statement statement = connection.createStatement();
          ResultSet resultset = statement.executeQuery("SELECT ename FROM emp");
          //print the name out
          while(resultset.next())
            System.out.println(resultset.getString(1));
          //close the resultset, statement, and connection
          resultset.close();
          statement.close();
          connection.close();
        catch(SQLException sqle)
          System.err.println(sqle);
    }  C:\CODE-JDBC\ORACLE\TEST-CONNECT>java JdbcTest
    java.sql.SQLException: Io exception: The Network Adapter could not establish the connection

    Replace this line:
    DriverManager.registerDriver(new racle.jdbc.OracleDriver());with this one:
    Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();

Maybe you are looking for