Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 17476 invoked from network); 6 Mar 2007 17:22:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Mar 2007 17:22:56 -0000 Received: (qmail 75285 invoked by uid 500); 6 Mar 2007 17:23:03 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 75260 invoked by uid 500); 6 Mar 2007 17:23:03 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 75249 invoked by uid 99); 6 Mar 2007 17:23:03 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2007 09:23:03 -0800 X-ASF-Spam-Status: No, hits=3.4 required=10.0 tests=HTML_MESSAGE,MSGID_MULTIPLE_AT X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [196.25.240.80] (HELO ctb-mesg-1-2.saix.net) (196.25.240.80) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Mar 2007 09:22:50 -0800 Received: from isanusid800 (dsl-243-176-143.telkomadsl.co.za [41.243.176.143]) by ctb-mesg-1-2.saix.net (Postfix) with ESMTP id E7F3ABE0E for ; Tue, 6 Mar 2007 19:22:24 +0200 (SAST) From: "Abdullah Kauchali" To: References: <51341F848370D64B848C054164F8175E22B8E044@HQSNA01SMXS01.corp.firstam.com> <16178eb10703060840k22c2f053y88b01f6be491ce6@mail.gmail.com> In-Reply-To: <16178eb10703060840k22c2f053y88b01f6be491ce6@mail.gmail.com> Subject: RE: What is RequestScope used for? Date: Tue, 6 Mar 2007 19:22:26 +0200 Organization: iSanusi Systems Architects Message-ID: <000901c76014$03645d30$0a2d1790$@kauchali@isanusi.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_000A_01C76024.C6ED2D30" X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AcdgDtVvql68xUCzQFOQNzJOIThPSwABNTmQ Content-Language: en-us X-Virus-Checked: Checked by ClamAV on apache.org This is a multipart message in MIME format. ------=_NextPart_000_000A_01C76024.C6ED2D30 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Notwithstanding the OP's issue . is there any sensible way of preventing this? Ie. how to detect connections are being returned to the pool without them properly ending transactions? Is it even possible? From: Clinton Begin [mailto:clinton.begin@gmail.com] Sent: Tuesday, March 06, 2007 6:40 PM To: user-java@ibatis.apache.org Subject: Re: What is RequestScope used for? Yep, you have a leak and it is RequestScope related...but it's likely not an ibatis bug... It's more likely that you're not ending transactions properly. try { sqlMapClient.startTransaction(); ///... do work } finally { sqlMapClient.endTransaction(); } Clinton On 3/6/07, Kalcevich, Daniel < dkalcevich@firstam.com > wrote: OK, upon looking at the Yourkit, I am showing the number of objects in memory as the following: - com.ibatis.sqlmap.engine.impl.SqlMapClientImpl - 212 objects with a total retained size in memory of 31.38MB - com.ibatis.sqlmap.engine.scope.RequestScope - 108, 544 objects with a total retained size in memory of 16.49MB. - com.ibatis.sqlmap.engine.scope.SessionScope - 27,136 objects with a total retained size in memory of 3.03 MB. Do those numbers make sense? I only question it because with every snapshot of the memory I have taken along the way, the RequestScope/SessionScope objects keep increasing. Daniel _____ From: Kalcevich, Daniel Sent: Tuesday, March 06, 2007 7:04 AM To: 'user-java@ibatis.apache.org' Subject: RE: What is RequestScope used for? I found about this RequestScope through the profiler YourKit. Here is the trail that references the IBatis objects. map of com.ibatis.sqlmap.engine.scope.RequestScope --[121] of java.lang.Object[513] ---elementData of java.util.ArrayList ----list of java.util.Collections$SynchronizedRandomAccessList -----pool of com.ibatis.common.util.ThrottledPool ------requestPool of com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega te ------delegate of com.ibatis.sqlmap.engine.impl.SqlMapClientImpl -------client of com.ibatis.dao.engine.transaction.sqlmap.SqlMapDao TransactionManager --------transactionManager of com.ibatis.dao.engine.impl.DaoContext ---------[0] of java.lang.Object[11] ----------elementData of java.util.ArrayList -----------value of java.lang.ThreadLocal$ThreadLocalMap$Entry ------------[1442] of java.lang.ThreadLocal$ThreadLocalMap$Entry[2049] -------------table of java.lang.ThreadLocal$ThreadLocalMap --------------threadLocals of java.lang.Thread [Stack Local, Thread] The reason I thought it might be contributing to a memory leak was the fact that at every snapshot I take, the number of HashMaps continues to increase without going down. Then when I look at what it is referring to, it points to the RequestScope. While looking in the trace, I saw that it was referencing the DaoContext's transaction Manager. Could the Transaction Manager be playing a part in this? My application uses Spring with SQL Maps, but a library we wrote uses the DAO Framework specifically. The Spring application does not use it. I think that is worth looking into, given what I see in the profiler. Daniel _____ From: Kalcevich, Daniel Sent: Monday, March 05, 2007 11:37 AM To: 'user-java@ibatis.apache.org' Subject: What is RequestScope used for? Hello, I have a Spring, Struts, SQL Map application that runs on JBoss/Tomcat. And while going through a profiler, I am seeing that there are several instances of "com.ibatis.sqlmap.engine.scope.RequestScope". What is that object used for? The reason I ask is that I am trying to track down a memory leak and am wondering if this class is possibly part of the cause? Any help is greatly appreciated. Thank you. Daniel ------=_NextPart_000_000A_01C76024.C6ED2D30 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Notwithstanding the OP’s issue …  is = there any sensible way of preventing this?  Ie. how to detect connections are being returned = to the pool without them properly ending transactions?

 

Is it even possible?

 

 

 

From:= Clinton = Begin [mailto:clinton.begin@gmail.com]
Sent: Tuesday, March 06, 2007 6:40 PM
To: user-java@ibatis.apache.org
Subject: Re: What is RequestScope used for?

 

Yep, you have a leak = and it is RequestScope related...but it's likely not an ibatis bug...

It's more likely that you're not ending transactions properly.

try {
  sqlMapClient.startTransaction();
  ///... do work
} finally {
  sqlMapClient.endTransaction();
}

Clinton

On 3/6/07, Kalcevich, = Daniel < = dkalcevich@firstam.com> wrote:

OK= , upon looking at the Yourkit, I am showing the number of objects in = memory as the following:

&n= bsp;

-          = co= m.ibatis.sqlmap.engine.impl.SqlMapClientImpl – 212 objects with a total retained size in memory of = 31.38MB

-          = co= m.ibatis.sqlmap.engine.scope.RequestScope – 108, 544 objects with a total retained size in memory of = 16.49MB.

-          = co= m.ibatis.sqlmap.engine.scope.SessionScope – 27,136 objects with a total retained size in memory of 3.03 = MB.

&n= bsp;

Do= those numbers make sense?  I only question it because with every = snapshot of the memory I have taken along the way, the RequestScope/SessionScope = objects keep increasing.

&n= bsp;

Da= niel

&n= bsp;


From:= Kalcevich, = Daniel
Sent: Tuesday, March 06, 2007 7:04 AM
To: 'user-java@ibatis.apache.org'
Subject: RE: What is RequestScope used for?

 

I= found about this RequestScope through the profiler YourKit.  Here = is the trail that references the IBatis objects.

 

map = of com.ibatis.sqlmap.engine.scope.RequestScope

--[121] of java.lang.Object[513]

---elementData of java.util.ArrayList

----list of java.util.Collections$SynchronizedRandomAccessList

-----pool of com.ibatis.common.util.ThrottledPool

------requestPool of com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelega = te

------delegate of com.ibatis.sqlmap.engine.impl.SqlMapClientImpl

-------client of com.ibatis.dao.engine.transaction.sqlmap.SqlMapDao TransactionManager

--------transactionManager of com.ibatis.dao.engine.impl.DaoContext

---------[0] of java.lang.Object[11]

----------elementData of java.util.ArrayList

-----------value of java.lang.ThreadLocal$ThreadLocalMap$Entry

------------[1442] of java.lang.ThreadLocal$ThreadLocalMap$Entry[2049] =

-------------table of java.lang.ThreadLocal$ThreadLocalMap

--------------threadLocals of java.lang.Thread [Stack Local, = Thread]

 

 

The = reason I thought it might be contributing to a memory leak was the fact that at = every snapshot I take, the number of HashMaps continues to increase without = going down.  Then when I look at what it is referring to, it points to = the RequestScope.

 

While looking in the trace, I saw that it was referencing the DaoContext's = transaction Manager.  Could the Transaction Manager be playing a part in = this?  My application uses Spring with SQL Maps, but a library we wrote uses = the DAO Framework specifically.  The Spring application does not use = it.  I think that is worth looking into, given what I see in the = profiler.

 

Daniel=

&n= bsp;

&n= bsp;


From:= Kalcevich, = Daniel
Sent: Monday, March 05, 2007 11:37 AM
To: 'user-java@ibatis.apache.org'
Subject: What is RequestScope used for?

 

Hello,=

 =

I = have a Spring, Struts, SQL Map application that runs on JBoss/Tomcat.  And = while going through a profiler, I am seeing that there are several instances = of "com.ibatis.sqlmap.engine.scope.RequestScope".  What is = that object used for?  The reason I ask is that I am trying to track = down a memory leak and am wondering if this class is possibly part of the = cause?  Any help is greatly appreciated.  Thank you.

 =

Daniel=

 

------=_NextPart_000_000A_01C76024.C6ED2D30--