Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 90429 invoked from network); 14 Mar 2008 14:00:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Mar 2008 14:00:15 -0000 Received: (qmail 90465 invoked by uid 500); 14 Mar 2008 14:00:00 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 90432 invoked by uid 500); 14 Mar 2008 14:00:00 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 90421 invoked by uid 99); 14 Mar 2008 14:00:00 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Mar 2008 07:00:00 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=HTML_IMAGE_RATIO_04,HTML_MESSAGE,MIME_QP_LONG_LINE,SPF_PASS,WHOIS_NETSOLPR X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.136.44.41] (HELO n69.bullet.mail.sp1.yahoo.com) (98.136.44.41) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 14 Mar 2008 13:59:17 +0000 Received: from [216.252.122.219] by n69.bullet.mail.sp1.yahoo.com with NNFMP; 14 Mar 2008 13:59:30 -0000 Received: from [69.147.84.116] by t4.bullet.sp1.yahoo.com with NNFMP; 14 Mar 2008 13:59:29 -0000 Received: from [127.0.0.1] by omp208.mail.sp1.yahoo.com with NNFMP; 14 Mar 2008 13:59:29 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 980096.33224.bm@omp208.mail.sp1.yahoo.com Received: (qmail 9530 invoked by uid 60001); 14 Mar 2008 13:59:29 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=vszWQotKGOF8Tci/1KQRUtMrprcaLsItJWiykTWIX9ZqbDfoRPhUZKnJ9QJHkJKP+l3gRw9N5Z55Ad9vAOLWgYDbms16DI4k00abKgqDOxEWuLFDHwsGs6t9+vVBziONd3QbYJ28T2RzL+igxwSm3tgjMoEINevmDRSloxc/kOM=; Received: from [220.225.96.24] by web46006.mail.sp1.yahoo.com via HTTP; Fri, 14 Mar 2008 06:59:29 PDT X-Mailer: YahooMailRC/902.38 YahooMailWebService/0.7.162 Date: Fri, 14 Mar 2008 06:59:29 -0700 (PDT) From: Bently Drake Subject: Re: Database connections grow after redeploy To: Tomcat Users List MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-986930857-1205503169=:5726" Message-ID: <729257.5726.qm@web46006.mail.sp1.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org --0-986930857-1205503169=:5726 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Memory leaks and deadlocks and CPU hogs! Java application developers often = face these runtime problems. They can be particularly daunting in a complex= application with multiple threads running through hundreds of thousands of= lines of code -- an application you can't ship because it grows in memory,= becomes inactive, or gobbles up more CPU cycles than it should.=0A =0AHere= are some tools that can help you finding out your application performance.= You can monitor thread usages, memory leaks, instance count etc; also in c= ase of web application you can find out the number of sessions, number of r= equest per second, average response time, database connection time, error c= ount etc.=0A =0A1 JProfiler: JProfiler is an award-winning all-in-one Java = profiler. JProfiler's intuitive GUI helps you find performance bottlenecks,= pin down memory leaks and resolve threading issues. You can use it to moni= tor a standalone java application or a web application.=0A =0Ahttp://www.ej= -technologies.com/products/jprofiler/overview.html=0A =0AFeatures:=0A =0A= =B7 Live profiling of a local session=0A=B7 Live profilin= g of a remote session=0A=B7 Offline profiling=0A=B7 Snaps= hot comparisons=0A=B7 Memory profiling=0A=B7 Heap walker= =0A=B7 CPU profiling=0A=B7 Thread profiling=0A =0A =0A=0A= =0A =0A =0A =0A =0A =0A=0A =0A =0A =0A =0A =0A =0A=0A =0A =0A =0A2. Manage= Engine=AE Applications Manager 8=0Ahttp://manageengine.adventnet.com/produc= ts/applications_manager/applications-monitoring-features.html=0AApplication= s Manager provides in depth monitoring of web applications, be it a CRM app= lication, banking / finance application or any business critical applicatio= n. Applications Manager can also help monitor the underlying infrastructure= which may consist of application servers, databases, systems, mail servers= and other Java/J2EE Applications. =0AThrough the application monitoring fe= ature you can ensure the health and availability of your application server= s through Microsoft .NET Monitoring, Oracle Application Server Monitoring, = JBoss Monitoring, Tomcat Monitoring, WebLogic Monitoring, and WebSphere Mon= itoring. Out-of-the-box support for databases through Oracle Monitoring, SQ= L Server Monitoring, MySQL Monitoring, DB2 Monitoring is also present.=0A = =0AApplications Manager helps ensure higher uptime by detecting and diagnos= ing problems of application servers and their services faster=0A=0A =0A =0A= =0A=0A3. JMeter=0Ahttp://jakarta.apache.org/jmeter/=0A =0A =0AApache JMete= r is a 100% pure Java desktop application designed to load test functional = behavior and measure performance. It was originally designed for testing We= b Applications but has since expanded to other test functions.=0A =0AApache= JMeter may be used to test performance both on static and dynamic resource= s (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP= Servers and more). It can be used to simulate a heavy load on a server, ne= twork or object to test its strength or to analyze overall performance unde= r different load types. You can use it to make a graphical analysis of perf= ormance or to test your server/script/object behavior under heavy concurren= t load=0A =0AApache JMeter features include: =0A=B7 Can load and pe= rformance test HTTP and FTP servers as well as arbitrary database queries (= via JDBC) =0A=B7 Complete portability and 100% Java purity . =0A=B7= Full Swing and lightweight component support (precompiled JAR uses= packages javax.swing.* ). =0A=B7 Full multithreading framework all= ows concurrent sampling by many threads and simultaneous sampling of differ= ent functions by seperate thread groups. =0A=B7 Careful GUI design = allows faster operation and more precise timings. =0A=B7 Caching an= d offline analysis/replaying of test results. =0A=B7 Highly Extensi= ble: =0Ao Pluggable Samplers allow unlimited testing capabilities. = =0Ao Several load statistics may be choosen with pluggable timers . = =0Ao Data analysis and visualization plugins allow great extendibili= ty as well as personalization. =0Ao Functions can be used to provide= dynamic input to a test or provide data manipulation. =0Ao Scriptab= le Samplers (BeanShell is fully supported; and there is a sampler which sup= ports BSF-compatible languages) =0A =0A=0A =0A =0A =0A4 Lambda Probe (forme= rly known as Tomcat Probe)=0Ahttp://www.lambdaprobe.org/d/index.htm=0A =0A = =0A =0ALambda Probe (formerly Tomcat Probe) is a self sufficient web applic= ation, which helps to visualize various parameters of Apache Tomcat instanc= e in real time. Lambda Probe is designed to work specifically with Tomcat s= o it is able to access far more information that is normally available to J= MX agents.=0A =0AJVM memory usage monitor =0AJBoss compatibility =0ADisplay= of deployed applications, their status, session count, session object coun= t, context object count, datasource usage etc =0AAbility to view deployed J= SP files =0ADisplay of list of sessions for a particular application =0AGra= phical display of datasource details including maximum number of connection= s, number of busy connections and configuration details =0ADisplay of syste= m information including System.properties, memory usage bar and OS details = =0AAbility to show information about log files and download selected files = =0AAbility to tail log files in real time from a browser. =0AAbility to int= errupt execution of "hang" requests without server restart =0ASupport for D= BCP, C3P0 and Oracle datasources =0ASupport for Tomcat 5.0.x and 5.5.x =0AS= upport for Java 1.4 and Java 1.5 =0A =0A=0A=0A =0A =0AAnd here are some mor= e that you can explore=0A =0ATools for tracking down memory leaks.=0AXPCOM = Memory Leak tools (this document also has information on Mozilla's other me= mory leak tools). See also a tutorial on using these tools and the refcount= balancer. =0ARational Purify=AE. (Commercial) =0AGlowCode. (Commercial) = =0AElectricFence. =0A"Electric Fence ... uses the virtual memory hardware o= f your system to detect when software overruns the boundaries of a malloc()= buffer. It will also detect any accesses of memory that has been released = by free(). Because it uses the VM hardware for detection, Electric Fence st= ops your program on the first instruction that causes a bounds violation." = =0ASpecifically, it works by placing each heap allocation on its own VM pag= e. Since the dynamic footprint of the browser is pretty large, this may mak= e it tough to use "in real life". =0ALeaky. This is a home-grown tool that = Kipp put together: =0A"Its a tool called leaky. What it does it help you tr= ack down memory leaks and some kinds of memory corruption. It also has entr= y pointers for logging addref/release calls. The key thing that leaky does = is this: it logs all calls to malloc/free/realloc/new/delete into a log fil= e. The logging data includes information about size and address, as well as= the *call stack of the operation*. The leaky program then can translate th= e call stack data from addresses into symbols and then dump the data out." = * =0Arefcount balancer. This is another home-grown tool that does finer-gra= ined instrumentation and allows you to focus on specific objects rather tha= n entire runs. =0AInsure++=AE. (Commercial) Evaluation copy is free. Linux = version. =0ALeakTracer. =0Accmalloc. =0Adebauch Dead? =0Amemwatch. =0AGeode= sic Systems' GreatCircle Dead? Scott Furman has done some preliminary work = to get this product working with Mozilla. =0AJulian Seward writes of Valgri= nd, an open-source memory debugger and profiler for Linux/x86: `Snapshots 2= 0020511 and later of the tool are able to run Mozilla correctly on both Red= Hat 6.2 and 7.2. It will also do detailed low-level I1/D1/L2 cache profili= ng, so you can see which bits of Mozilla create cache misses. You'll need t= he patch from bug 124335 if working with versions prior to 1.0RC2. =0AProfi= ling=0AThe following tools are used to measure product performance.=0ARatio= nal PurifyPlus. (Commercial) Used to be called Rational Quantify. =0Aqfy2ht= ml.pl. A Perl script for munging Quantify 6.0 output into hyperlinked HTML = to share with your friends. Run Quantify, save your results as text, and th= en let this thing rip. =0AQuantifying Mozilla on Solaris. Instructions on h= ow to make Quantify play nicely with Mozilla on Solaris. =0AFor performance= work on Mac, you can use either the Metrowerks Profiler (on subsets of the= codebase), or Apple's Instrumentation SDK. For details, see the page on Ma= c performance. =0Ahiprof. A hierarchical instruction profiler for Digital U= nix. There is an online tutorial, courtesy Jim Nance (jim_nance@yahoo.com):= =0A"I like it because it does not require you to recompile the program, be= cause it give accurate times for callers, and because it comes with DU so t= hat everyone developing there should already have it." * =0Ajprof. Sampling= profiling tool by Jim Nance that runs on RedHat 6.1, 6.2. =0AMOZ_TIMELINE = Timing instrumentation. Extremely useful for app startup measurements. =0Ae= azel profilers. Two profiling tools from Eazel/gnome.org, runs on Linux. = =0AJS Runtime Profiler. Profile JavaScript usage, dumps output to a file. = =0ASysinternals utilities. Win9x/Me/NT/2K utilites for monitoring system us= age. CPU/Mon, Diskmon, Filemon, Regmon, etc. =0Agprof. Part of the GNU Binu= tils. Back in May 1999 there were rumors that gprof had trouble with dynami= cally linked and loaded objects (like Mozilla). Currently (March 2006) gpro= f is still being developed, so hopefully that's no longer true (assuming it= ever was). The link to the gprof manual above is years out of date but, at= the time of writing, it's the latest version of the manual on gnu.org. To = get an up to date version of the manual, get the gprof source and run |. co= nfigure; make html| in the gprof source directory. =0A =0A =0A=0A=0A=0A----= - Original Message ----=0AFrom: David Cassidy =0ATo: T= omcat Users List =0ASent: Friday, March 14, 2008 7= :13:17 PM=0ASubject: Re: Database connections grow after redeploy=0A=0Atry = netbeans=0Aits free and the profiler will watch all your objects being crea= ted.=0Ait will also work with snapshots...=0A=0A=0A=0A=0AOn Thu, 2008-03-13= at 20:56 +0200, Juha Laiho wrote:=0A> Scott McClanahan wrote:=0A> > > On T= hu, 2008-03-13 at 12:02 -0400, Christopher Schultz wrote:=0A> > > Caldarale= , Charles R wrote:=0A> > |> From: Scott McClanahan [mailto:scott.mcclanahan= @trnswrks.com]=0A> > |> Subject: Re: Database connections grow after redepl= oy=0A> =0A> > | As far as the continuing data base connections, I can only = speculate=0A> > | that the prior instances of the webapp are still active, = thereby=0A> > | preventing cleanup of their resources.=0A> =0A> > > I agree= .. Scott: are you able to run your application through a tool that=0A> > > a= llows you to observe the heap and object graphs?=0A> =0A> > > More likely i= s that one or more application-level objects has retained a=0A> > > referen= ce to a specific Connection object, which, of course, retains=0A> > > refer= ences back to the connection pool that created it. I would check=0A> > > an= y ServletContextListener classes you have, and then a generic search=0A> > = > for putting things into the ServletContext, since that is one of the=0A> = > > only places that applications typically store long-lived objects.=0A> = =0A> > Do you have any suggestions for a profiling tool like you described?= =0A> > Preferably open source. Thanks.=0A> =0A> Don't know about open sour= ce products, but I can vouch for YourKit Java=0A> Profiler. As far as I kno= w, the main difference between YourKit and other=0A> profilers is that Your= Kit allows you to work through snapshots, whereas=0A> other profilers injec= t their probes into Java object creation methods.=0A> This means that more = or less the only moment when YourKit has an effect=0A> on the performance o= f your application is when you take a memory snapshot.=0A> The other profil= ers I've seen attempt to trace each object allocation and=0A> deallocation = in real time, which can be rather CPU consuming (especially=0A> if you're t= racing a problem you cannot replicate in test environments).=0A> With YourK= it, you take snapshots of the Java VM memory of your application,=0A> and c= ompare them "off-line" (i.e. without needing any connection to the=0A> live= application).=0A=0A=0A----------------------------------------------------= -----------------=0ATo start a new topic, e-mail: users@tomcat.apache.org= =0ATo unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org=0AFor additi= onal commands, e-mail: users-help@tomcat.apache.org=0A=0A=0A _________= ___________________________________________________________________________= =0ALooking for last minute shopping deals? =0AFind them fast with Yahoo! S= earch. http://tools.search.yahoo.com/newsearch/category.php?category=3Dsho= pping --0-986930857-1205503169=:5726--