Tools for checking spring performance and bottlenecks with example [closed] - java

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
i am new to all this performance improvement thing. Can anyone provide names of some good tools or techniques for checking the performance of the web application and finding the bottlenecks in the application both on server side and client side. If any one can provide link examples or tutorials to such tools or techniques it will be very helpful. Thanks in advance for your help.
Using VisualVM i got following result
please do let me know how to find the code in my application which is responsible for this.

Improving the performance of a web application involves couple of things.
Improving the application code involves :
Apply caching - E.g. JCS, EHCache
Compression of HTTP requests
Avoid Embedding of Javascripts
Balance the load - Horizontal/Vertical Scaling
Cookie size reduction
Use profiling tools like JProfiler, jProbe, JRockit, VisualVM
EDITED for the changed question :
Are you getting Out of memory Error ?
To find Memory related issue, Take snapshot at regular interval and look for possible leaks. Using the Deltas mode you can easily watch newly allocated and disposed objects over a specific period of time or while an action is executed which makes it really easy to identify a memory leak. Also, the memory data can be saved as a .nps snapshot which can later be compared to other memory snapshots using the Compare function. Once the memory leak is identified, you can investigate the leak further by using the built-in HeapWalker. The HeapWalker has been enhanced to support displaying retained sizes and provides a powerful OQL scripting engine.
Furthermore, you can use other tools for heap analysis like :
HAT, The Java Heap Analysis Tool
YourKit Java Profiler
Memory Analyzer project at Eclipse, contributed to them by SAP.
HeapWalker is a good option too.

Have you tried visualVM, its free and powerful tool to track the J2EE performance application, some of its features:
Provide a CPU profiling.
Provide all info about Threads.
Provide the JVM Heap and the memory states.
Provide Info about the GC activities.
Its come with the JDK package, so you don't have to install it, for more info check this

Related

Best and safest Java Profiler for production use? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I'm looking for a Java Profiler for use in a very high demand production environment, either commercial or free, that meets all of the following requirements:
Lightweight integration with code (no recompile with special options, no code hooks, etc). Dropping some profiler specific .jars alongside the application code is ok.
Should be able to connect/disconnect to the JVM without restarting the application.
When profiling is not active, no impact to performance
When profiling is active, negligible impact to performance. Very slight degradation is acceptable.
Must do all the 'expected' stuff a profiler does - time spent in each method to find hotspots, object allocation/memory profiling, etc.
Essentially I need something that can sit dormant in production when everything is fine without anyone knowing or caring that it is there, but then be able to connect to it hassle (and performance degradation) free to pinpoint the hard to find problems like hotspots and synchronization issues.
Have you tried YourKit? It has almost all of the features you are looking for.
Java VisualVM is a tool that provides a visual interface for viewing detailed information about Java technology-based applications (Java applications) while they are running on a Java Virtual Machine (JVM). Java VisualVM organizes JVM data that is retrieved by the Java Development Kit (JDK) tools and presents the information in a way that enables you to quickly view data on multiple Java applications. You can view data on local applications and applications that are running on remote hosts. You can also capture data about the JVM software and save the data to your local system, and view the data later or share the data with others. This comes with Oracle JDK it self...
$ jvisualvm
I have been happy with jProfiler.
I prefer Java Flight Recorder. It causes almost no performance overhead and has a nice GUI. Add JVM parameters
-XX:+UnlockCommercialFeatures -XX:+FlightRecorder
-XX:StartFlightRecording=name=test,filename=test.jfr,dumponexit=true
and open the record with JMC.
Checkout CA Wily.
http://www.ca.com/us/application-management.aspx
I use Eclipse TPTP - Eclipse Test & Performance Tools Platform Project. Whether it is suitable for production use or not, it depends on the user. For me, it's fine and it does meet your needs.
http://www.eclipse.org/tptp/
Another option is http://www.newrelic.com/. We have been using it in production for some time, and it seems to be pretty reliable and performant. Simple to setup (one .jar and a -agent commandline option).
There's another new option called javosize
When I looked for "best java profiler" on google, I saw on the first non-paid link (it's a blog), the same tool on the comments to the post:
https://blog.oio.de/2014/03/07/java-profilers-a-short-comparison-between-jprofiler-yourkit-and-javas-visualvm/
Hope it helps!
Edit: As comments say, linkedin link is to a private forum. Sorry for it. Here is the link to main site:
http://www.javosize.com/gettingStarted.html
FusionReactor Java Application Performance Monitor, also includes a very low overhead Java Profiler as part of its feature portfolio.
http://www.fusion-reactor.com/production-java-profiler/
FusionReactor can be installed in a couple of minutes & they have a free 14 day trial to test it out.
Take a look at Java Mission Control in conjunction with Flight Recorder. Starting with the release of Oracle JDK 7 Update 40 (7u40), Java Mission Control is bundled with the HotSpot JVM, so it is highly integrated and purports to have small effects on run-time performance. It has call tree functionality like Callgrind.

Tools to map threads to their memory usage?

Having some performance issues in a Weblogic 11g production system.
As part of the debugging effort, I’m interested in finding a way to map threads to their memory usage, then seeing the stack to determine what part of the application is consuming so much.
Anyone know of a tool or method to do what I want to do?
I'm not interested in JProbe memory profiling as it requires too much overhead (taking snapshots of everything). Also, I've read about Heapwalker in NetBeans that seems promising.
Eclipse has a memory analyzer (or heap walker, if you will) called mat - http://eclipse.org/mat/.
I've used it in the past and it was pretty helpful. I don't remember off-hand all the features, but I do remember being able to identify "heavy" threads, querying for largest objects, and such.
The home page links to several tutorials and a blog that are useful as well.

Know of any Java garbage collection log analysis tools? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 7 years ago.
Improve this question
I'm looking for a tool or a script that will take the console log from my web app, parse out the garbage collection information and display it in a meaningful way.
I'm starting up on a Sun Java 1.4.2 JVM with the following flags:
-verbose:gc -XX:+PrintGCTimeStamps -XX:+PrintGCDetails
The log output looks like this:
54.736: [Full GC 54.737: [Tenured: 172798K->18092K(174784K), 2.3792658 secs] 257598K->18092K(259584K), [Perm : 20476K->20476K(20480K)], 2.4715398 secs]
Making sense of a few hundred of these kinds of log entries would be much easier if I had a tool that would visually graph garbage collection trends.
gcviewer does what you want.
IBM's GC toolkit does exactly what you ask.
https://www.ibm.com/developerworks/java/jdk/tools/gcmv/
I'm not sure if it's compatible with GC logs from Sun's JVM though.
I think some people are adding Java probes which don't really parse garbage collection logs as the question states...
I've tried others (gcviewer, gchisto, IBM's) and the best tool I found for analyzing GC logs is HPjmeter
It is mainly for HP-UX JVMs, but it also usually works with Sun JVMs and does a great job.
(source: xebia.com)
I tried a online tool http://gceasy.io , it can read my sun jdk 1.8 gc log.
Even better than jconsole is visualvm, which is developed and distributed freely by Sun. It has a GC analyzing plugin called gchisto which might help you.
Edit: Sorry, I didn't see your JDK 1.4.2 requirement. In that case visualvm won't help you, alas.
The most powerful tool I've found to work with both IBM and Hotspot JVM logs and visualize them is IBM's PMAT:
https://www.ibm.com/developerworks/mydeveloperworks/groups/service/html/communityview?communityUuid=22d56091-3a7b-4497-b36e-634b51838e11
I find it both faster and gives more details than the tool in IBM Support Assistant.
It is being continually updated, lastly July'12.
However seems to have some problems parsing logs with policy CMS but hopefully that can be fixed.
PrintGCStats is pretty good too, and gives good statistics, but not for visualization over time, that needs some work.
I use YourKit java profiler, which lets you measure this sort of thing, and much more, but using it's own format rather than analysing the log. It can do more under Java 5, but should work under 1.4.
Try VisualGC from Sun. There are JDK 4 and 5 versions that give you a nice visual of what's going on in the eden, generational, and perm spaces. You need to add a JAR and get a PID and Bob's your uncle.
A few years ago, John Coomes (Hotspot GC group) had released PrintGCStats, an awk script to "summarize statistics about garbage collection, in particular gc pause time totals, averages, maximum and standard deviations.". A copy of the script is hosted on java.net : http://java.net/projects/printgcstats
jconsole can help you a lot, but I think it's Java 5 and later only. Once I heard someone of SUN speaking at our university and he said that Java 6's garbage collector is A LOT better than the old ones which needed complicated tuning nearly all the time for big applications. Java 6 GC seems to scale a lot better on SMPs.
gchisto plugin for VisualVM doesn't work https://gchisto.dev.java.net/
I have a file with all details of printgc for jdk1.6 but couldn't find a tool to read that.
Previously with jdk1.5 we used HPjmeter it worked fine, but now with jdk1.6 it doesn't
Tried following: IBM Pattern Modeling and Analysis Tool for Java Garbage Collector -- it doesn't recognizes the file. GCCollector doesn't work, it keep on reading file for analysis.
How about trying out some profiling tool like JProbe Freeware (Eclipse plug-in).

What would you recommend for a large-scale Java data grid technology: Terracotta, GigaSpaces, Coherence, etc? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I've been reading up on so-called "data grid" solutions for the Java platform including Terracotta, GigaSpaces and Coherence. I was wondering if anyone has real-world experience working any of these tools and could share their experience. I'm also really curious to know what scale of deployment people have worked with: are we talking 2-4 node clusters or have you worked with anything significantly larger than that?
I'm attracted to Terracotta because of its "drop in" support for Hibernate and Spring, both of which we use heavily. I also like the idea of how it decorates bytecode based on configuration and doesn't require you to program against a "grid API." I'm not aware of any advantages to tools which use the approach of an explicit API but would love to hear about them if they do in fact exist. :)
I've also spent time reading about memcached but am more interested in hearing feedback on these three specific solutions. I would be curious to hear how they measure up against memcached in the event someone has used both.
You may want to check out Hazelcast also. Hazelcast is an open source transactional, distributed/partitioned implementation of queue, topic, map, set, list, lock and executor service. It is super easy to work with; just add hazelcast.jar into your classpath and start coding. Almost no configuration is required.
Hazelcast is released under Apache license and enterprise grade support is also available. Code is hosted at Google Code.
We had a 50 servers running a webservice application and all these servers were load balanced using bigIP. The requirement was to cache each user state so that subsequent states don't do the same processing again and get the data from previous state. This way the client of the webservice don't need to maintain state.
We used Terracotta to cache the states and never faced any performance issue. At peak times number of request application is getting is 100 per second.
The library you choose really depends on your application and what you're trying to achieve.
I worked for a shop that used Coherence to provide scalability (and redundancy, sort of) for it's web applications. We found that you have to have around 4-5 nodes to start getting any benefits from Coherence (2 or 3 nodes potentially reduces performance). I believe Oracle's docs say you need lots (30+) nodes to really get a benefit with Coherence. If you do go with Coherence, make sure you get your hardware set up properly - it is very sensitive to latency.
I personally would stay away from a "drop-in" stuff. They might give you something to start with, but you'll eventually run into synchronization or performance problems and will have to start writing code specific to your grid layer anyway. Basically, you know your app better than the library, and will be able to figure out which items need to be in cache, how long they need to live, how your app will be used, etc.
I don't have enough experience with these technologies, but I think Apache Hadoop is proved to be scalable and reliable. Yahoo ran it on 10,000 core Linux cluster.
It's based on Google MapReduce algorithm.
This article describes MapReduce and why you should care about it.

Which Java profiler is better: JProfiler or YourKit? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Which profiler is better for general purpose profiling and heap analysis? 90% of our apps are standalone command line programs with substantial database and numeric processing. The other 10% are webapps/servlet container apps (with very little JSP and NO SCRIPLETS!). Target user would be Sr Software Engineer with 5-10 years of industry experience. We need support only for Sun JDK 5 and.
As of writing this question (2008-10-02), JProfiler was at 5.1.4 and YourKit was 7.5. Looks like YourKit 8.0 will be released soon.
I've used both JProfiler 4 and YourKit 7.5, and YourKit wins hands down. It's so much less invasive than JProfile, in that I'll happy run production servers with the YourKit agent installed, which I would never do with JProfiler.
Also, the analysis tool that comes with YourKit is more intuitive (in my opinion), making it easier to get the root cause of problems.
If you're on jdk >=1.6_07 you might also want to look at jvisualvm which comes bundled.
Having used both JProfiler and Yourkit recently I find that yourkit is far superior for memory problem analysis and strongly prefer jprofiler for performance analysis. Yourkit's memory analysis seems to be much easier and intuitive. For performance analysis on yourkit I have been unsuccessful in resolving any performance issue I have tried to resolve with yourkit. JProfiler shows more accurate and concise information for performance analysis with the exact number of method invocations and percent time spent in each method. I have yet to find this in yourkit. It seems yourkit just gives sampling information which is not accurate unless you are measuring thousands of invocations.
I've used JProbe, OptimizeIt, and YourKit all extensively and they're all capable tools. Of the 3, my all around favorite is YourKit.
The one killer feature in JProbe is the ability to move from a perf snapshot to annotated source (with counts and timings). I found that to be exceptionally useful.
None of the tools other than JXInsight perform real database transaction analysis:
http://www.jinspired.com/products/jxinsight/concurrency.html
http://www.jinspired.com/products/jxinsight/olapvsoltp.html
JXInsight's Probes technology is also the only one that could even run in production considering that we out perform netbeans profiler by 20x and yourkit 100x in SPECjvm2008 benchmarks.
http://blog.jinspired.com/?p=272
I am the architect of JXInsight so of course I am completely biased but at the same time I am probably more qualified than most in the Java industry to make such a claim since I have devoted the last 8 years to performance analysis for some of the most demanding of Java/J2EE application in production.
I should be point out that JXInsight is designed for software performance engineers and not just for the occasional adhoc profiling session. We have more than 4000+ system properties to configure the runtime and 600+ technology extensions libraries so it might be overkill unless one has a complex problem to solve and/or using the same tool across development, test and production is paramount.
Kind regards,
William
With Java 7 Update 40, Oracle included Java mission control (originally part of the JRockit JDK) - a very powerful performance tuning tool which is able to compete with yourkit/jprofiler.
Take a look and be surprised.
I have used both and my vote now is definitely JProfiler (in the current version 6) as it is easier to use and has a lot of useful additional features. In previous releases YourKit had some advantages with larger snaphots, but this is gone now.
Definitely YourKit ... It was able to open 4 gigs heap dump with just 1g of heap used. While Jprofiler with same heap allocation crashed!
i've used yourkit and it is a very nice profiler, the best i've ever used in java (i've used a variety of others over the years). that being said, i've never used jprofiler, so i can't give a direct comparison.
For quick and dirty profiling of command-line programs, JIP works really well.
Been using JProfiler for years and very happy with it. IntelliJ seems to switch their recommendation back and forth between YourKit and JProfiler so I would guess their feature sets are similar. I believe they both have trial version.
DISCLAIMER : Alternate answer.
they have various products for production monitoring/profiling UNLIKE other mostly development time tools : http://www.jinspired.com/products/jxinsight/
This post on theserverside on JDBInsight : http://www.theserverside.com/news/thread.tss?thread_id=13488
DISCLAIMER : I am NOT associated with this company at any level.
I have used YourKit. I have not used JProfiler. I have used OptimizeIt before. I have very good opinion about YourKit. It is very stable and good GUI and good feature list. One unique feature I have noticed is CPU profiling with and without wait time (like I/O wais) including.
It is priced also very reasonably (about about $1100 for 5 licenses I think)
YourKit is great. You might also want to check out the profiler built into NetBeans--it's pretty cool.
Yourkit
It's low overhead, stable, easy to install on the JVM to be profiled (just one dll) and powerful.
For analyzing heap dumps it's the only profiler that comes close to the Eclipse Memory Analyzer.
I've only used JProfiler (and some JProbe). As far as I can tell, one limitation of YourKit is that they don't appear to support JDK 1.4.2. That's not an issue for many people, but it might be.
+1 for yourkit --- using 7.0 on dev boxes in windows
not used JProfiler for a while -- cannot comment since they might have improved in the meantime.
Just as an aside, you may want to consider the Netbeans profiler -- it's pretty good. But I've not used either of the two you mentioned.
I am using JProfiler and find it overall OK. It's "dynamical instrumentation" feature is terribly biased for small methods, though.
I am using the TPTP profiler. the best feature it has that this can be integrated very easily in Eclipse but the bad thing is that it makes the Eclipse run slower.
Definitly YourKit. It is the most intuitiv and stable!

Categories