I need to use profiler in my IDE - java

I am using RSA7 as IDE, I need to use profiler in my IDE for memory analysis.
Can any one suggest me
From where I can free download it?
How can I use it with RSA7?
Many Thanks

You don't absolutely need it to be integrated in your IDE, JProfiler is a great one and runs outside the IDE. Although it can run in most IDE's, that you should check on their site JProfiler
Remark: It's not Free, but a profiler pays for it selfs, once you sum up the time it saved you then you understand that it is well spend money!

VisualVM comes with the JDK and includes a pretty good memory profiler. Also not integrated with RSA, but doesn't really need to be.

Related

Java Profiling Tool for CPU consumption

I have used JProfiler, JProbe, AppSight, YourKit for the finding out what code is consuming CPU.
But YourKit looks better than others.
Is there anything better ?
There is jvisualvm in the Sun 6 JDK. It is "better" because it is gratis and easy to use, pretty simple but has the killer feature of being able to attach to a program which is already running. It is a stand alone version of the NetBeans profiler which is also gratis.
If "better" includes price, these are hard to beat.
You cannot ask which is better unless you define what you mean by "better". Basically it's horses for courses. Everyone has their own preferences as to which is the best tool and for what reasons.
There are the main tools I've seen, but it's up to you which you prefer.

Best way to measure Memory Usage of a Java Program?

I'm currently using VisualVM, but the problem I'm having is that I can't save the graphs it generates. I need to report some data about its memory usage and running time, though running time is easy to get with System.nanoTime(). I've also tried the NetBeans profiler but it isn't what I want, since I'm not looking for specific parts that would be slowing it down or anything, so that would be overkill. The biggest problem with it is that it eats up too much processing time. Also doesn't let me capture/transfer the data easily, like VisualVM, at least as far as I can tell.
Ideally the best way to go about it would be some method call because then I'd be able to get the information a lot more easily, but anything like VisualVM that actually lets me save the graph is fine. Performance with VisualVM is pretty good too, compared to the NetBeans profiler, though I suppose that's because I wasn't using its profiler.
I'm currently using Ubuntu, but Windows 7 is fine. I'd rather have a program that specializes in doing this though, since the information gotten by programs who don't is likely to include the JVM and other things that would be better left out.
Well, apparently, you can save snapshots of the current session and maximize the window in VisualVM, so you could make the charts bigger, take a snapshot and cut them... But that's kind of a hack. Better suggestions welcome.
Runtime.getRuntime().freeMemory();
Runtime.getRuntime().totalMemory();
Look at the Runtime class. It has freeMemory, maxMemory, and totalMemory. That's probably close enough for your purposes.
You may prefer graceful method to measure memory, rather than hack image.
JConsole is known to Monitor Applications by JMX,it provides program API. I guess it is what you need.
See: Using JConsole to Monitor Applications
Try JProfiler. Although its not free you can try evaluation version first.
The HPjmeter console is free. Run your Java process with -Xloggc:<file> and open the <file> with it. Not only can you save your sessions, but you can compare runs. Other options to consider including in your command line are:
-XX:+PrintGCTimeStamps
-XX:+PrintGCDetails

Java Profiling on Linux

I have a fairly complex Java application that is utilizing a lot of CPU, and would like to know if there is any recommendation on a profile tool that I could use to determine the cause of the CPU utilization. My goal is to pinpoint the location in the code where it is using most of the CPU time.
I've used jProfiler and YourKit on Linux. But you might find the information you're looking for by running the jconsole that comes with recent JDKs. Good information on how to use it: http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html
Netbeans has good built-in profiler. NB runs quite well on Ubuntu 9.10
If your issue cannot be observed in developement, you can attach the profiler to a remote JVM (your production environment). You have to configure the host JVM to accept the JMS/JConsole connections from the profilers. The JMS/JConsole realtime monitoring visualization charts look pretty awesome.
I have used Visual VM in the eclipse IDE. If you are not on an IDE, jhat and jconsole will help. Google jhat for more info
If you are comfortable with Eclipse, I'd recommend TPTP.
If you use Sun Java 6 then learn to use jvisualvm in the JDK on the machine running the troublesome program.
It will answer most of your questions, can attach effortlessly to an already running program and is gratis.
This method is low-tech but works best. Here's a short explanation why.
Since you are not running under an IDE, you can use pstack or lsstack to get stack samples. If the app is using lots more time than it should, then most likely the problem is one or a few rogue function calls, which will be clearly visible on most of the stack samples.

What advantages have a commercial Java profiler over the free ones, e.g. the one in Netbeans?

Occasionally I have to do some profiling work on Java code, and I would like to know why I should have my boss investigate in a commercial profiler as opposed to just use the one in Netbeans or JConsole?
What would the killer features be that would warrant the investment?
In my experience with JProfiler, it's just an all-round slicker experience than the NetBeans profiler. It's easier to get started, easier to interpret the information and, although I haven't measured it, it seems that JProfiler has less of a negative impact on the performance of the application being profiled.
Also, JProfiler integrates nicely with IntelliJ IDEA. I have to use NetBeans to use the NetBeans profiler, which is an inconvenience because I have to manually configure a free-form project to match the layout of my project.
The NetBeans profiler is usable. Unlike IntelliJ, I wouldn't buy a JProfiler licence for my personal projects because, unlike an IDE, it's not a tool you use all day every day. However, for paid work there's no reason not to buy a better tool. It's not expensive compared to the cost of a developer's time.
I have experience using both NetBeans profiler and JProbe. For performance profiling I have found Netbeans quite useful but where JProbe is superior is for memory profiling.
JProbe has superior tools for comparing heap snapshots and finding the root cause of a memory leak. For example, in JProbe you can view heap shapshots visually as a graph, select nodes to investigate and then delete references to see if the instance could then be garbage collected.
If you are using Netbeans already then starting up the profiler is easy (unless you are using a Maven based project... sigh).
I have used paid profilers as well as the Netbeans one. Netbeans does the job well enough (it was a bit rough when it first came out... but much better now).
The code I profile isn't HUGE so I cannot say if the time spent in profiling is a major factor.
The answer is highly subjective and totally depends on your needs. Things to look at:
1) ease of use in your environment (in the case of NetBeans it is likely that the built in profiler is easiest.
2) time spent starting the prfiler to it actually getting you usable results
3) is it a sampling or tracing profiler? (An overview is here: http://docs.hp.com/en/5992-0757/ch05s01.html
4) can you view the results live or do you have to wait for the profiling to finish?
Here is a link to a slashdot discussion on Java profilers: http://ask.slashdot.org/article.pl?sid=06/06/30/0053237
I've not used Netbeans profiler, but tried JProfiler, Yourkit and JProbe. I found Yourkit slightly better (mainly bought by the usability aspect). Some of the useful features in it are: (you can check if it is available in Netbeans)
J2EE Profiling (Eg. It shows how much time an SQL query took).
Snapshot comparison and annotation
Deadlock detector
Exception telemetry
You can check for more details at their site.
I would say that, ready to use and more performance statistics. I was assigned a profiling job last year when I was interning at a multinational. I used the InfraRED profiler which uses Java aspect oriented API (works with both Aspectwerkz and AspectJ). But I had to extend the profiler to get what my manager wanted. Also, the performance statistics given by the profiler was limited.
But before selecting the profiler I researched a few other opensource profilers. Some of them were trivial and didnt suit what we wanted.
I would also add that, some of them just doesnt work. For example, if we want to collect performance statistics of a web application, all the profilers doesnt support those statistics required for us.
With a completely independent profiler, it's much easier to integrate it with other applications in your toolchain. For example, say you want to run the profiler as part of your build process (say, once a night). Something like JProfiler easily integrates with ANT, whereas profilers built into IDEs may or may not. If you have a separate build machine, installing a local copy of a profiler makes sense, but installing a whole IDE just to get access to one component does not.
If you are using Tomcat you might consider lambdaprobe
http://www.lambdaprobe.org/
(It is for free)
From my experience, YourKit profiler is most usable one. Small usability things really make the difference, but also it is most comprehensive one, containing:
most comprehensive and usable memory snapshots (working also with 1GB+ heaps), with detail object view and primitive data, for every single object. (for example in hashmap you can see if objects are evenly distributed or most are stored in same bucket!) This detail of memory snapshots and its ease of use is my main reason for yourkit.
very little overhead (far less then many other profilers I used)
comparing snapshots
J2EE profiling
deadlock detector, lock status (I think it still misses java.concurrent.locks, bud for synchronized it is great)
Among other things, it's also constantly improving, so who knows what is future holding :)
Compare the features and see if you really need the features provided by commercial software over the free one. If yes then its worth investing.

Java profiler for IBM JVM 1.4.2 (WebSphere 6.0.2)

I'm looking for a Java profiler that works well with the JVM coming with WebSphere 6.0.2 (IBM JVM 1.4.2). I use yourkit for my usual profiling needs, but it specifically refuses to work with this old jvm (I'm sure the authors had their reasons...).
Can anybody point to a decent profiler that can do the job? Not interested in a generic list of profilers, BTW, I've seen the other stackoverflow theread, but I'd rather not try them one by one.
I would prefer a free version, if possible, since this is a one-off need (I hope!) and I would rather not pay for another profiler just for this.
Old post, but this may help someone. You can use IBM Health Center which is free. It can be downloaded standalone or as part of the IBM Support Assistant. I suggest downloading ISA since it has a ton of other useful tools such as Garbage Collection and Memory Visualizer and Memory Analyzer.
What are you looking to profile? Is it stuff in the JVM or the App Server? If it's the latter, there's loads of stuff in WAS 6 GUI to help with this. Assuming you really want to see stuff like the heap etc, then the IBM HeapAnalyzer might help. There are other tools listed off the bottom of this page.
Something else I've learned, ideally, youll be able to connect your IDE's profiler to the running JVM. Some let you do this to a remote one as well as the local one you are developing on. Is the JVM you wish to profile in live or remote? If so, you might have to force dumps and take them out of the live environment to look at at your leisure. Otherwise, set up something local and get the info from it that way.
Update: I found out that JProfiler integrates smoothly with WAS 6.0.2 (IBM JDK 1.4).

Categories

Resources