Java Profiler tool on Mac OS X

Viewed 16116

I'm developing both a Java app and J2EE webapp using Eclipse Europa on Mac OS X 10.5.8. The webapp provides a RESTful API layer for the Java app I've written. I'm running the webapp using tomcat from inside Eclipse.

It seems like there are some serious performance issues and I would like to use a profiler to narrow down on these problems, but I haven't been able to find anything decent to work with. I've looked at the following options:

  • TPTP, ships with Eclipse: A known bug prevents the profiler from running on Mac :(
  • JProfiler: doesn't have a Mac version
  • Profiler4J: Installed it, but couldn't get it to work
  • Shark: comes with MacOSX, but when I choose "Java Time Profile" and run my webapp, it doesn't allow me to choose any processes to profile
  • Other tools I looked at cost a lot of $$ and this is an open-source project

I've looked through this list: here but there are too many choices and too little time to go through them ALL!!

Does anyone know of an easy-to-use visual Java profiler that actually works on Mac, given my environment? I would love to hear your suggestions.

Thanks a lot guys, Ali

5 Answers

Be aware that Shark does not work with Java running in 64-bit mode. With OS X 10.6 java runs in 64-bit by default. If you give java the "-d32" flag when it starts, it will run in 32 bit mode. Combine this with the "-agentlib:Shark" flag, and then start Shark. You now should be able to profile your Java program using OS X 10.6 and Shark. If profiling Java in 32-bit mode is acceptable, then this might be of use to you.

Related