Slashdot Mirror


Java Profilers - Which One Are You Using?

splitPersonality asks: "Our Java programmers are researching various profilers to use in-house. We would appreciate some feedback from other shops that are using Java profilers. Along with the specific product, would you please include reasons behind your choice? If you now have misgivings about the one you or your shop chose, please let me know about those, as well."

79 comments

  1. The netbeans one. by Anonymous Coward · · Score: 0

    The netbeans one, whatever it's called.

    It let me know exactly how long it took for new GUI windows to be created.

    1. Re:The netbeans one. by Anonymous Coward · · Score: 0

      So, like, 15 seconds? You need a profiler to tell you that?

  2. JProfililer by er824 · · Score: 0

    I've used JProfiler quite a bit. We picked it because it was reasonably priced and reasonably well featured. It is offered by a fairly small company and I've found the support to be pretty good.

    1. Re:JProfililer by iezhy · · Score: 1

      JProfiler is perfect for memory consumption issues.
      To detect performance bottlenecks I prefer JProbe.
      Those two together make a perfect suite

  3. YourKit: awesome profiler by jnana · · Score: 5, Informative
    I give my most enthusiastic recommendation to YourKit. It takes about a minute to install, has optional integration (1-click) with Eclipse, IDEA, Netbeans. I use Eclipse, and the integration there adds a new 'Profile as' options that works just like the 'run as' and 'debug as' launch options.

    YourKit is extremely easy to use thanks to a very intuitive interface.. All the java developers I've shown it to have been as impressed as I've been. It is cheaper than most profilers -- I got a deal on it for $125 a few months ago, which I is about 25% of the normal price, but it's still cheap at $499. It's not open-source, but they have a forum where they answer they questions extremely quickly. I've had 1 or 2 bugs since I've been using it (about 10 months), since I like to use the early release version for newer features, and both have been fixed within days, with a new build released within a week or so. Memory leaks are a snap to find using it's "compare snapshot", which lets you compare 2 snapshots and shows you what the difference is -- memory leak is generally the difference if you capture your snapshots intelligently.

    Anyway, I can't speak highly enough of the product. For the record, I have no affiliation with them at all. I'm just a very happy customer.

    My only minor gripe is that under some circumstances, the fastest CPU profiling option (unnoticeable impact on the running app) can give inaccurate results, in which case I have to use one of the two slower CPU profiling options, which are much, much slower--but that's certainly not particular to YourKit.

    1. Re:YourKit: awesome profiler by dubl-u · · Score: 2, Informative

      I give my most enthusiastic recommendation to YourKit.

      I second this. It's been a year or two since I looked, but I was happy to pay my own money for the YourKit profiler. In particular, I like the good UI. As with an IDE, I think it's worth paying for a good tool when it substantially increases my productivity, and the YourKit tool fits that.

    2. Re:YourKit: awesome profiler by Anonymous Coward · · Score: 0

      I third this. It even works with J2ME.

    3. Re:YourKit: awesome profiler by speculatrix · · Score: 1

      I fourth this. In demonstrating it to a colleague shortly after receiving it, I found a major bottleneck in our corporate portal which allowed a 20% performance increase - saving the cost of the license just in server hardware alone!

    4. Re:YourKit: awesome profiler by Anonymous Coward · · Score: 0

      Here's a thought: Learn to program. If you programmed anything with a 20% extra bottleneck, you've got other things to worry about than some stupid bottleneck.

    5. Re:YourKit: awesome profiler by Anonymous Coward · · Score: 0
      At least be a good troll!

      Trivial counterargument: If 20% wasn't common, why do you think people bother with profilers?

      If you're not a troll and just a fool that talks about things you don't know -- a little advice.

      Get a book on algorithms and read about how different implementations scale with data sets. A program "perfectly" optimized on some data might be factors of ten slower on other data. While an implementation of.. ah, never mind. Just study some computer science.

    6. Re:YourKit: awesome profiler by dubl-u · · Score: 1

      Here's a thought: Learn to program. If you programmed anything with a 20% extra bottleneck, you've got other things to worry about than some stupid bottleneck.

      As Knuth said, "Premature optimization is the root of all evil." Or as Robert Martin says, the proper order is "make it work; make it right; make it fast."

      People are slightly irresponsible when putting software into production without any profiling. But hey, if it runs fast enough, then it's fast enough. But developers who optimize without measuring before and after are usually being hugely irresponsible. The guy did it in the right order.

  4. Profilers by overbarg · · Score: 2, Informative

    Java's available sets of tools for this kind of stuff is woefully inadequate, but here's what I use: NetBeans Profiler: Not bad for what it does, Memory Stack Allocation tracers are nice, but I haven't been able to get it to profile just certain methods in a selected class. It also seems pretty stable over long periods of time and doesn't interfere too much with the running of the application. JMP: I started using this for it's heapwalking abilities. Other things I've tried are hprof and hat... but with no success at all. JMP is not stable over long periods of time. It will frequently just decide to take a vacation even if you aren't monitoring anything, but for tracking down things like object owner chains, it's very good. Haven't done any actual performance profiling, so that's the extent of my knowledge.

    1. Re:Profilers by Anonymous Coward · · Score: 0

      I optimized the heck out of some code last week using Netbeans profiler. It was great. I recommend that. Hey, If you don't like it you can always ask for your $0 back.

  5. Re:Which one? Isn't it obvious... by Anonymous Coward · · Score: 4, Informative

    I use several tools depending on the application.

    For step-through-your-code debugging nothing beats Jprobe, although perhaps a fellow slashdotter
    can suggest a public domain equivalent

    If you want to profile your code in a "production" situation, i.e. you need minimal overhead
    while instrumenting methods to understand where in your stack trace time is being spent
    you have two options. Mercury Interactive sells a product that instruments all methods,
    aggregates method usage and gives you a "top talker" summary. Wyle Introscope on the other
    hand instruments only the methods you want, but can drill down into things like JDBC and capture
    executed SQL. Their product Leakhunter can help you find memory leaks, but creates too much drag for prod usage.

    Finally if want something that combines elements of Mercury's inclusive approach of instrumenting
    everything and top talker summaries and with Wyles approach of watching for heap usage, GCs and so
    on you want a copy of YourKit. I own all the products mentioned but have to say YourKit is my current favorite.

  6. OptmizeIt by SuperKendall · · Score: 2, Informative

    Although I've not had call to use one for a few years, I've liked OptimizeIt for a long time - they were bought by Borland but I think you can still buy the software on its own.

    JProbe also seemed pretty good...

    I also had good luck with HAT (heap allocataion tool, built into Java) if you are just looking for memory leaks. The HProf stuff also works and again is built in.

    ---> Kendall

    --
    "There is more worth loving than we have strength to love." - Brian Jay Stanley
    1. Re:OptmizeIt by Sircus · · Score: 1

      We're also happy OptimizeIt users. It seems to do almost everything we could want from it and mostly satisfies our needs. That said, its GUI is *awful*. If you're looking for functionality, I don't know of any reason not to choose it. But if prettiness is a requirement, give it a miss.

      --
      PenguiNet: the (shareware) Windows SSH client
  7. Re:Which one? Isn't it obvious... by Anonymous Coward · · Score: 0

    Hello? Profilers. As in: not debuggers.

    Just write everything in Ruby; you won't need a profiler then because it is dog slow no matter what.

  8. JRat by Anonymous Coward · · Score: 5, Informative

    JRat is open-source, and works anywhere using bytecode injection. It's the only serious solution for profiling applications running in production as it

    A) doesn't require much overhead
    B) doesn't require code changes
    C) doesn't require some sort of front-end to monitor or use
    D) doesn't have a rediculous cost per server
    E) runs in your typical environment, not some magical profiling IDE option

    We use this every day (via an ant task) to profile a Wall Street trading system that handles billions of dollars of transactions every week. Would you trust that to anything else?

    Signing anon because my employment contract specifically prevents me from revealing this sort of thing :) Enjoy.

    1. Re:JRat by Anonymous Coward · · Score: 0

      Signing anon because my employment contract specifically prevents me from revealing this sort of thing :) Enjoy.

      It's okay... we know who you are based upon your spelling of "rediculous" and use of uppercase parenthesized letters as bullet points. Posting anon so you don't know who ratted you out.

    2. Re:JRat by Believe · · Score: 1

      ... and doesn't support java 1.5 and hasn't been updated in a loooong time. I checked it out a few months ago and unless something has changed in the meantime, it's basically a dead project and not usable for anyone working on non-legacy systems.

  9. hprof by sfjoe · · Score: 1

    The tools that come with Java, while not at all user-friendly, have always been enough to point us in the right direction. We've never really come across a situation where we couldn't find the problem or optimize the code once the right track has been pointed out. YMMV.

    --
    It's simple: I demand prosecution for torture.
  10. JProfiler by Flwyd · · Score: 2, Informative

    We bought a few JProfiler licenses a few years ago and have had good success with it. It can easily profile remote JVMs (servlet containers, for instance). I've used the Heap Walker a few times to discover static references that shouldn't be kept around and have had good success finding performance bottlenecks.

    I hear recent versions plus 1.5 resolve a lot of stability and performance problems, but I haven't had enough problems to warrant pulling it out in a while. It's not a perfect product, but it's told us what we need to know.

    --
    Ceci n'est pas une signature.
    1. Re:JProfiler by Wizard+of+OS · · Score: 2, Interesting

      Oh, I saw I forget to mention the features I used:
      - attach the profiler to a remote machine (in our case a test environment)
      - trace memory allocations: you can see live which objects live in the JVM
      - memory snapshot, this makes a snapshot in which you can see which objects live, which other objects have references to it, where it was allocated etc. So if you have a mem-leak, you can find out exactly why the object wasn't GC'ed
      - cpu profiling: see which methods take how many percent of your processing, and fold open the call-tree for such a method to see which methods it calls and how much time is spent there.

      --

      --
      If code was hard to write, it should be hard to read
    2. Re:JProfiler by elFarto+the+2nd · · Score: 1

      Yep, I've used it at work to profile out J2EE application and find some memory leaks in our applet. Very useful product, and definetly recommended.

      Regards
      elFarto

    3. Re:JProfiler by mikeburke · · Score: 1

      +1 Of all the profilers I've used, I have found this to be the most intuitive. This is a really important attribute. A lot of the time, this kind of software gets used to sort out a super-critical production/customer issue, and developers don't always have the luxury of time to figure out the quirks and metaphors behind a product.

    4. Re:JProfiler by mikeburke · · Score: 1
      You hit the nail on the head mate.

      JProfiler just works, and you get the information you need really quickly. I'm not a shill, just a fan. I've introduced it to my new employer, and the developers now go through a compulsory JProfiler session before any significant changes get committed. We're working in a large, mostly legacy code base, where the impact of changes isn't always understood. Just ordered another 3 floating licenses. Yes, it's about AUD 3000, but that is repayed sooooo quickly.

    5. Re:JProfiler by easter1916 · · Score: 1

      Ceci n'est pas une signature...

    6. Re:JProfiler by Anonymous Coward · · Score: 0

      Yes, it's about AUD 3000, but that is repayed sooooo quickly.

      Invest in a spellchecker and you'll be repaid even quicker.

  11. PerfAnal.jar by edwinolson · · Score: 4, Interesting

    Believe it or not, I do most of my profiling by running by using:

    alias java-prof='java -agentlib:hprof=cpu=samples,depth=8,interval=1,thr ead=y'

    And then I view the results with PerfAnal.jar (google will find it for you), an extremely old (and even ugly) GUI that is also clean and mean. It's also free (beer? not sure.)

    I've tried a number of other profilers (JFluid, YAJP, etc.), and they usually prove to be too much of a pain in the ass, or just give nonsense data.

    Mind you, I'm usually interested in pure CPU performance-- tightening inner loops and things like that. I don't care too much about memory profiling or garbage collector behavior since I've long since eliminated most allocations in my performance-sensitive code.

    Sadly, no profiler really satisfy me. Usually, line-by-line CPU usage just can't be computed given the optimization performed by HotSpot: you'll see trace-by-trace CPU usage, where a trace covers several lines of code. It makes it hard to know exactly where the CPU time is being spent. (You can run with -Xint, but the performance is so different without HotSpot that it's not helpful.)

  12. Re:If you care about performance... by SirSlud · · Score: 4, Insightful

    Have you ever actually worked at a company in your life?

    If I invented something tonight which was faster than whatever you were using today, and yet you were running into memory leaks that required restarting or rebooting servers you run 24/7, and losing thousands of dollars by the minute, but were within reach of serving your current load if you could identify the leaks, would you turn off your servers until you finished rewriting your application in my language?

    He's not asking about 'performance', hes asking about how to chase memory leaks via a profiler. He's not concerned about performance, hes concerned about RAM usage due to memory leaks due to programming bugs. Please tell me people like you are not actually employed as programmers or programming project leads. You're advise is as useful as the lowest of the low tech support, "Oh, thats your problem? Well, you should just probably quit everything you're doing, and re-invest from the ground up in some other product or technology."

    Its useless advice because thats not the question being asked. And just like low tech support, he probably knows more about the alternatives than you do.

    --
    "Old man yells at systemd"
  13. For us... by Leftmoon · · Score: 4, Informative

    We use DevPartner which seems to work pretty well for me. It's fairly neat the way it works. Although it does seem to identify some things as memory leaks that probably aren't actually leaks (ResultSets, IBM MQ Series objects, etc), if you limit the check to your own packages, a lot of your in-house errors will stand out right way and it will ignore the (assumed) false spots. Give it a try.

  14. Eclipse TPTP by sgifford · · Score: 3, Interesting

    I've used the Eclipse Test & Performance Tools Platform with pretty good results:

            http://www.eclipse.org/articles/Article-TPTP-Profi ling-Tool/tptpProfilingArticle.html

    1. Re:Eclipse TPTP by Relgar · · Score: 1

      I like and use Eclipse TPTP as well. I've used OptimizeIt before and fiddled with JProbe before settling on Eclipse TPTP.

      Subjectively, I liked JProbe's interface more, but they only supported Java 1.4 at the time, whereas OptimizeIt and Eclipse TPTP supported 1.5 (which I was using).

      I find Eclipse TPTP a little finnicky to set up though. I've set it up two or three times, and I must not be understanding the instructions properly - they're very detailed and specific, but it doesn't go smoothly for me.

    2. Re:Eclipse TPTP by whitelines · · Score: 1

      TPTP is awesome. It has some quirks (like depending on your working directory you sometimes have to manually fiddle with the config xml so it profiles correctly). However the new version has integration points with the Web Tool Project WTP, which means you can profile on your container. Obviously the biggest draw is that it's completely free.

      --
      /* TBD */
  15. Memory leaks? What are you talking about? by Anonymous Coward · · Score: 1, Funny

    Read his question again. Here, I'll even quote it for you:


    splitPersonality asks: "Our Java programmers are researching various profilers to use in-house. We would appreciate some feedback from other shops that are using Java profilers. Along with the specific product, would you please include reasons behind your choice? If you now have misgivings about the one you or your shop chose, please let me know about those, as well."


    Do you see any reference to "memory", "memory leaks", "RAM consumption", and so forth? No, you do not. Because that's clearly not what he's asking about.

    Unless specifically qualified as "memory profiling", the term profiling is meant to refer to measuring the time spent in certain pieces of code. Anyone who has any experience, be it industrial, academic or hobbyist, knows that simple fact.

    If he (or his superiors) actually did know more about the alternatives, then they wouldn't be asking about what Java profiler is best. Why is that? Because they wouldn't be using Java! They'd be using Python, Ruby, C++, or any number of other languages that offer better performance, and far better memory usage.

    And it's best if you avoid ad hominem attacks while debating. It's very poor style, in case you weren't aware. We're trying to have a serious discussion here about this fellow's software development predicament, and you keep bringing up personal insults. Please, for the sake of helping this individual, refrain from such childish behavior in the future.

    1. Re:Memory leaks? What are you talking about? by kramulous · · Score: 1

      Bravo!

      I'm also with eolson@mit.edu (above) ... learn to declare variables in the appropriate spot.

      --
      .
    2. Re:Memory leaks? What are you talking about? by splitPersonality · · Score: 2, Informative

      Few things not stated in my original post: While I do support the choice, I have no control over the language choice for in-house development. Having done large enterprise programming for many years and in many languages, it is my opinion that pure performance is rarely the sole reason a programming language is chosen. The decision usually considers the size of the talent pool, including in-house, available & reputable contractors, as well as job-seekers. Doesn't matter how good a language is if you can't easily hire programmers. I am not saying this is the sole consideration and definately not the primary one, but it is a big one. Others factors were open-source projects that could be used in conjunction with our developement, costs (IDE's and other tools), available quality education for existing staff, and a raft of others. Point is that the language choice is effected by the total cost of using it. We have also been sucessfully doing many smaller projects in java for several years. Fairly easy to track down any issues that come up. We are now laying the foundation for a massive multi-year project using contract programmers and new hires. We may not have any performance tuning issues early in the project, but what about in a year or two or five? Any experienced developer knows, you try to anticpate issues like that and lay the foundation for discovery and tuning BEFORE the coding starts. A profiling tool makes a lot of sense under these circumstances. One thing I learned a long time ago, doesn't matter how good and/or detailed the design process is, when the coding starts, stuff happens. The larger the team on the project, the higher the stuff factor. I don't know you or your professional background, so I may be merely reminding you of something you (should) already know.

      --
      "I don't suffer from insanity, I enjoy every minute of it." - author unknown
  16. JProfiler by LadyLucky · · Score: 1

    I had good results with JProfiler when tracking down some memory leaks in our Java app. Found out we were hanging on to some references much longer than we should have. JProfiler lets you snapshot counts of objects (after GC), do this again after a 'test run', and then find the offending objects. You can then locate where they were allocated, who is still holding on to them and so forth. Neat.

    --
    dominionrd.blogspot.com - Restaurants on
  17. -1 troll +5 funny by Toveling · · Score: 4, Funny

    A stopwatch.

    1. Re:-1 troll +5 funny by DrSkwid · · Score: 5, Funny
      This java so any one of :
      • An hourglass
      • The tides
      • Phases of the moon
      • Glacial movement
      • Radio active decay of Carbon-14
      • Radio active decay of Cadmium-116

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    2. Re:-1 troll +5 funny by ducttapekz · · Score: 1

      Generalizations are always true.

    3. Re:-1 troll +5 funny by metamatic · · Score: 1

      Java? Profiler?

      If performance was important I wouldn't have written the code in Java to start with.

      --
      GCHQ Quantum Insert installed. If only our tongues were made of glass, how much more careful we would be when we speak
  18. JMeter by LarsWestergren · · Score: 2, Interesting

    I have used JMeter a couple of times to detect bottlenecks and synchronization problems with web apps. Very simple to set up and run just using a GUI. Apart from http/https it can appearently call java methods, EJBs etc too, but I haven't tried that. I think this tool is easier to use for stress testing rather than going through a whole use case. Also, when running against a web server of course it just tells you that something is slow, not what.

    At Java One I talked to some fellow Swedes who were a bit disappointed with JProbe, they claimed it was a bit of a resource hog and that they had found a better more light weight open source library to use instead. I've looked through my notes, but it seems I didn't write down the name of the one they recommended. Darn.

    Symantec had an app that seemed pretty impressive, though I don't know how much they charge for it. I think it was this one. I remember them because unlike most who just had a lottery for prizes, you actually had to run the demo to be able to answer their quiz. Pretty clever, made people remember and gave you a better chance of winning because most people wouldn't bother. I won a PSP. :-)

    Also at Java One this year Sun had loads of labs and talks on profiling tools and frameworks that come with the JDK itself these days - JMX (especially in combination with DTrace if you run on Solaris), jconsole, jmap, jhat.

    And then of course there is this whole site...

    --

    Being bitter is drinking poison and hoping someone else will die

    1. Re:JMeter by (H)elix1 · · Score: 1

      Heh. You too? I saw how much traffic they had and figured it would be worth the time to study the whitepaper before taking the test. Most folks just winged it or did not bother. Profiling the booth paid out big time. One of the best bits of marketing swag I have ever brought home. (Grin)

  19. Re:If you care about performance... by blafasel · · Score: 2, Informative

    it's actually very easy to get excellent performance out of java -- just use data structures as you would use them in C:

    • use arrays, not array lists etc.
    • avoid memory allocation
    • avoid side effects (and make judicious use of the final qualifier)
    • use public static methods (which the compiler is happy to inline)

    i'm currently using java to do classical molecular dynamics simulation (and statistical analyses thereof: esra), and the speed (without any tweaking) is consistenly within a factor of two of what i would get with C/C++. this is certainly not so with python (which, for my numerical problems, turned out to be about four orders of magnitude slower).

    YMMW, but mine is excellent ... no more segfaults, dead-simple deployment, scriptability, eclipse etc.

    --

    check your speling
  20. JProfiler by Wizard+of+OS · · Score: 4, Interesting

    Interesting to see this question come up just a week after I was in deperate need of a profiler. I downloaded JProfiler 4.2 and got a test-license (for 10 days or so). (oh, and I work on a Mac, and it has downloads for 3 platforms).

    The problem I had was the following. We upgraded our system from the previous stable release of our opensource CMS to the new stable release. We knew a lot had changed in the internals, so we did a good functional testround and fixed quite a few issues. Quite confident in the new software (it appeared faster) we deployed on our live environment. Looked fine, until after a few hours it didn't stop Full-GC-ing, the symptoms of a memory leak. (and yes, I know how to tune my VM to optimum GC performance).

    All I can say about JProfiler is that after only 3 or 4 days, I found all memory leaks, several performance issues (even things like 'for (int i=0; istr.length(); i++)'), and got a real good feel about the bottlenecks inside the application. My manager just bought me a $400 or so license, and it's money very well spent.

    So next week we'll go live again, but now with a piece of software of which we exactly know how it behaves.

    I suggest you download the evaluation version and just give it a try. I can't imagine putting a release live anymore, without having profiled it for at least a day.

    --

    --
    If code was hard to write, it should be hard to read
  21. Re:If you care about performance... by famebait · · Score: 1

    Often times it doesn't matter how much you profile your Java application. The bottleneck will often be hidden away, deep in some class library that either you can't modify (due to licensing restrictions or unavailable source code), or that you don't want to modify.

    And that bit of information about your app is worth nothing to you? No wonder your java apps are slow.

    --
    sudo ergo sum
  22. "cool" corporate lingo by rgravina · · Score: 0, Offtopic

    Arrgh! I can't stand it when people refer to a company as a "shop" (especially when used to refer to software develeopment companies)! Really, it just sounds utterly stupid, like corporate trying so hard to be cool. I hear it all the time "oh, we we're a Java shop", "yeah, I hear they are an all Linux shop". It's irritating, unnessecary, not very descriptive and just plain stupid. Cut it out people!

  23. YourKit does the job by Anonymous Coward · · Score: 0

    We tried YourKit evaluation (30days) and was very pleased with the software. Sadly the license fee's are too high for my company, and it only gets you updates for one year. But I'd be interested to hear where the 75% discount version is available from???

    I think they also do a free licence for open source projects which other readers might find useful.

    From my experience of this tool it does everything you need. The integration with eclipse is simple, and remote profiling is really nice. For a large system the dumps can be quite large, maybe they could use a more compressed format, but then the application we are profiling has a max heap of 3GB so I guess we should expect some large files.

    The accuracy of the simple timing option wasn't the best, but the more detailed profiling seemed to give fairly consistent results. The GUI is very nice to use with lots of help and tips. It's also very responsive and you can quickly drill down through your code to find where the time is being spent.

    Summary: If you have a memory leak or performance problem in Java, this tool will find it. Could be cheaper!

    1. Re:YourKit does the job by Anonymous Coward · · Score: 0
      The 75% discount was a special they had at one point. I don't think they have it anymore, but you could always ask. They're a very small operation, so they may be open to negotiation.

      I had downloaded an evaluation version previously, and they sent me an email to that address that had the 75% off offer.

  24. Re:Which one? Isn't it obvious... by masklinn · · Score: 1

    Ruby actually comes with a built-in profiler (likewise for Python). The point? As for any profiler, discovering the bottlenecks of your applications to either change your algorithm (since you create the same functionality in 1/10ths of the time you have the time to refine your algorithms) or recode the bottleneck (and the bottleneck only) in a lower-level language (C or C++)

    --
    "The way we can tell it's C# instead of Haskell is because it's nine lines instead of two." -- wadler
  25. I definitely recommend JProfiler by Hazelnut · · Score: 1

    I definitely recommend JProfiler - I've used it for a couple of years now and it has always been easy to use and very effective at giving me the information I need.

    Hope that helps.

  26. Re:If you care about performance... by Anonymous Coward · · Score: 0

    For somebody with such a low UID, you're really bad at not feeding trolls.

  27. Re:If you care about performance... by mikeburke · · Score: 1

    Do you really find a performance difference with 'final' ?

    I'd be interested to hear your experiences here. I advocate 'final' as an aid to expressiveness, but understood the performance benefits were minimal these days.

  28. Re:If you care about performance... by Thunderbear · · Score: 2, Informative

    In a word no. (Except for aggresive inlining of code but I have not measured on that).

    "final" allow you to state information _in code_ about what you are doing about invariants, and letting the compiler enforce this.

    This allows the designer and maintainer to catch accidential assignments too. Not a bad thing.

    --

    --
    Thorbjørn Ravn Andersen "...and...Tubular Bells!"
  29. JProbe by tedgyz · · Score: 1

    I like JProbe. It's a little cumbersome to setup, but has great analysis tools with graphical call trees, call stack drill-down, etc. What I like the best is the ability to prune the results interactively to isolate the piece of code you are interested in.

    --
    "No matter where you go, there you are." -- Buckaroo Banzai
    1. Re:JProbe by Doctor+Memory · · Score: 2, Interesting

      I second this recommendation. I haven't used it for a few years, but the first time I did I was blown away by the level of detail you could get. Very easy to drill down to just about any level of detail you could want. ISTR it also had breakpoints on garbage collection, so you could examine the heap before and after GC. Very handy for making sure that something you thought should be reclaimed actually was, and very easy to trace the errant references if it wasn't.

      It seemed expensive at first, but in two days I was able to get a 30% speed improvement in the main body of our code, and found a nasty resource leak in the in-house framework we were using that I know they had spent several developer-weeks trying to track down.

      I'm not sure who owns it now (I think it was JProbe Inc when we ordered it, but by the time it shipped it was already owned by someone else, and I'm sure it's been sold at least once since then), but it's definitely one worth checking out.

      --
      Just junk food for thought...
    2. Re:JProbe by staplin · · Score: 1

      My team has also been using JProbe. We used the unsupported free edition for a while and decided it was worth it to go ahead and get the full version. We got a single concurrent license (as opposed to node-locked) and have been able to share it among 4-8 people successfully with little contention. The installation and management of the license server is easy, and hooking the clients up to it was dead simple.

      Their performance profiling is great, and their remote profiling works wonderfully as well. We had problems getting it to play nicely when running inside Oracle Application Server, though...

      I haven't used the memory leak analysis tools much, but my first impression is that the OptimizeIt tools I used several years ago were more straight forward. Maybe it's just needing to get more experience with it, as I said, I haven't used it much yet.

    3. Re:JProbe by GuyZero · · Score: 1
      I'm not sure who owns it now

      It was originally developed by a company called KL Group, which changed their name to Sitraka. Most people only knew about JProbe though, so a lot of people thought that was the company name too. In 2002 Sitraka was acquired by Quest Software.

  30. Re:If you care about performance... by espressojim · · Score: 3, Informative
    Often times it doesn't matter how much you profile your Java application. The bottleneck will often be hidden away, deep in some class library that either you can't modify (due to licensing restrictions or unavailable source code), or that you don't want to modify. Other times, the bottleneck will be in the inherently slow execution model of Java. Profile all you want, and change your algorithms all you want. Many times the only solution is to move away from Java in order to get the performance or scalability boost you may need.


    Last week I was profiling my code that connected to a database and retrieved data over and over. Originally, I'd bumped up the memory size on my VM to let the code run, because it was analysis code and didn't need to be super efficient until we moved it over to where the public could access it.

    The memory leak turned out to be in Oracle's jdbc driver. The TTCItem class was not being garbage collected, and a HUGE amount of memory (think everything sent over the wire from the database) was collecting. So, as you said, I had a bottle neck hidden away in a class library, and there was nothing I could do about it.

    Then I downloaded the latest oracle ojcbc14.jar, where I'd read on some forums that they'd patched the memory leak, and the problem went away. The problem was solved, the VM was running at 6M memory, and I was happy.

    If I hadn't had a profiling tool, I NEVER would have found that leak and fixed it. Who knew some versions of the oracle driver have a memory leak in their prepared statement handing? The solution isn't to walk away from Java, but to learn how to use the appropriate tools and programming techniques.
  31. Symantec's Indepth for J2EE by Intelopment · · Score: 2, Interesting
    Symantec has an awesome product called Indepth for J2EE, or i3 for J2EE depending on how you get it bundled. It's more designed for the production level/test level performance issues, as it's very customizable to balance level of detail with overhead. There's even a cool setting where you can specify the level of overhead you're willing to incur (specified as a %), then it determines the maximum amount of level of detail it can obtain, based on the level of overhead you've specifed. All this is done while the app is running. Very cool.


    It also works in concert with other performance tools from Symantec for other tiers in the enterprise, database tools, network tools, web server tools, web client tools. Then the tool suite combines all this 'tier level' information into an enterprise view and gives you a view of performance of the entire data center so you can determine which tier in the enterprise is the performance hog.

  32. JFluid by ungerware · · Score: 2, Informative

    JFluid (a.k.a the NetBeans Profiler)

    1. Free
    2. Trivial to configure/run (as easy as debugging in NB)
    3. You can specify a subset of the app to profile, and the rest of the app runs at full speed (profilers like JProbe force you to slow down the whole VM). This also makes the output much more readable, since you're not seeing all kinds of statistics from code you're not interested in.
    4. Attach/detach to a running application, which requires no special cmd line options when launching.
    5. Analysis tools are good at finding memory leaks, based on discerning patterns in allocation/deallocation

    Check it out at http://profiler.netbeans.org/

    --

    -----
    Kvetch is Yiddish for "throw an exception" --Dr. Ron Cytron
    1. Re:JFluid by Anonymous Coward · · Score: 0

      Someone mod up the parent post - Netbeans Profiler is da bomb.

    2. Re:JFluid by Anonymous Coward · · Score: 0

      Agreed, mod up. (Sayeth Mr. Anonymous never-bothered-for-an-account...)

      I use netbeans for most of my work in Java for various reasons which I shall avoid enumerating like a fanboy. (But rest assured, they are many.)

      Now, I'm just a hobbyist when it comes to the performance stuff, but the profiler integrates so smoothly it's not clear it's a separate download. Now I just need to program stuff where I actually hit performance bottlenecks...

      Anyway, it's free, integrates smoothly with a popular IDE, and I recommend you definitely check it out before looking for profilers you need to purchase.

      But don't take my word for it, check out their screenshots!
      http://profiler.netbeans.org/

  33. In Soviet America by Anonymous Coward · · Score: 0

    In Soviet Amerika the NSA profiles you!

  34. JIP by Anonymous Coward · · Score: 0
    The Java Interactive Profiler http://sourceforge.net/projects/jiprof/ is a very basic profiler -- just a notch or two above hprof. However, it does have a few things going for it:
    • Lightweight -- JIP is an exteremly fast profiler.
    • Interactive
    • Open Source
    • 100% Java
    While JIP can't complete with many commercial tools in terms of total functionality, it's simple and in most cases that's enough. Organization that can't pay for a commercial tool should certainly give it a try.
  35. Re:If you care about performance... by Anonymous Coward · · Score: 0
    I'm not the original poster, but thought I'd chime in. I use final extensively, but more as as matter of expressiveness than for performance reasons, as you state. I wish final were the default, but that's another issue.

    Having said that though, I did see one case recently where it made a big difference. On a Lisp newsgroup that I read, somebody implemented a cellular automaton algorithm in Lisp and Java for comparison, and he had a reference to non-final local variables (for no good reason) from within some gnarly nested loops (See here, especially message #2), and making just the top 4 local variables final (the ones used in the nested loops) yielded a large improvement (measured at around 7% using client vm, not sure about server vm because other changes were mixed into that measurement, but probably more considering its more extensive optimizations). Anytime not making the variable final will prevent the server vm from being able to inline the variable inside a bottleneck loop, it will make a huge difference, but it doesn't happen that often.

  36. Re:If you care about performance... by Anonymous Coward · · Score: 0
    Oh yeah. I remember that Oracle bug. And I found it by profiling under yourkit and noticing where all the memory usage was, followed by a quick google search.

    Oracle's JDBC drivers are complete crap, but that was bad even for Oracle.

  37. Many thanks for the feedback by splitPersonality · · Score: 1

    The replies to this post has given my team a lot of food for thought. As usual, the slashdot community replied with a lot of intelligent feedback and added a dash of humor too.

    I especially appreciated the discussions on features. Many had been on our wish list, but others had been overlooked.

    Thanks Again!

    --
    "I don't suffer from insanity, I enjoy every minute of it." - author unknown
  38. your sig by Anonymous Coward · · Score: 0

    Dude, it's bAnzai not bOnzai --> http://www.imdb.com/title/tt0086856/ Gotta love that movie.. :) ..

    1. Re:your sig by tedgyz · · Score: 1

      (blush) Thanks for the heads up.

      --
      "No matter where you go, there you are." -- Buckaroo Banzai
  39. Re:If you care about performance... by SirSlud · · Score: 1

    I wasn't feeding the trolls, the trolls were feeding me. See moderation of my post.

    --
    "Old man yells at systemd"
  40. Re:JFluid - NetBeans Profiler by HommeDeJava · · Score: 1

    I did not succeed to install eclipse plugins from TPTP (Tracing and Profiling Tools Platform) on my Mac. I think, but I'm not sure, that something is missing, something like platform specific software agents to run up the profiler on Mac. Then, I myself reminded a news about the release of the NetBeans Profiler for Mac OS X. http://profiler.netbeans.org/ What an experimental stuff! This is definitely the PROFILER for Java! (Cross my heart, I'm not working for Sun and I'm still using the eclipse IDE). I had to download and install NetBeans 5, an eclipse import module and switch to JDK 5. Bingo, just like that... and all is running fine on my PowerBook.

  41. YourKit by AttilaSz · · Score: 1
    YourKit, hands down, at least for memory profiling. When I was debugging few particularly nasty cases of memory leaks ( see http://www.szegedi.org/articles/memleak.html) it was the only profiler that got the Java Memory Model assumptions right, i.e.
    • didn't think static fields are GC roots (they aren't, they are reachable through classes, and classes are not GC roots, unless loaded by system classloader)
    • recognized that classes keep a strong reference to their classloader
    • recognized that array classes keep a strong reference to the classloader of their component type
    and maybe few others.
    I've tried OptimizeIt, JProbe, HAT (I even submitted patches to it to recognize some of the above), Eclipsecolorer, and YourKit in the past, and found that YourKit is the best for me.
    --
    Sig erased via substitution of an identical one.
  42. Apple platform includes Shark by johnBurkey · · Score: 1

    As a part of MacOSX dev tools, you get shark, which includes java profiling. What is nice about Shark is it is the tied to the kernel profiler as well, so you can switch from java to native profiling in a flash, with the same UI. Also, it includes a bunch of data mining features, such as filtering out small methods (profile time http://developer.apple.com/tools/sharkoptimize.htm l