Authors:
ORFJackal
BSD

VisualVM Profiler

Vendor: Esko Luontola

Email:

Website: http://plugins.intel....net/plugin/?id=3749

SourceCode: link

Bugtracker page

Description:

Launches VisualVM's Java profiler from within IDEA. VisualVM is based on NetBeans Profiler and is bundled with JDK 6 Update 7 and above. VisualVM may also be downloaded for free from https://visualvm.dev.java.net/
Downloads: 5289
Rating:
Participated in rating: 2
Version Since Build Until Build File/URL Size (Kb) Date Dependency
1.0.0. 80.9000. 85.9999. Download 133.92. 2008-12-08 14:50:29 .
1.0.0_7. 69.7000. 75.7999. Download 130.6. 2008-12-08 14:49:57 .
. .
VisualVM Profiler

Recent change notes:

1.0.0 (2008-12-08)
- Support for VisualVM 1.1
- Autodetect Java version when choosing the profiler interface to use (although officially VisualVM supports only Java 6 and 7)

0.4.2 (2008-11-26)
- Fixed possible NPE if the MainClass returned by IDEA was null

0.4.1 (2008-11-24)
- Fixed inconsistent naming of profiler actions (IDEA 8 only)
- Fixed the profiler actions appearing in every file's context menu (IDEA 8 only)

0.4.0 (2008-11-24)
- Compatible with IDEA 8
- Uniquely identify the application launched by IDEA

0.3.0 (2008-11-12)
- Memory profiling
- Settings are copied to VisualVM's user interface
- Saved space in the run configuration dialog by moving help texts to tooltips

0.2.0 (2008-11-09)
- Works with the bundled VisualVM which comes with JDK 6 Update 7 and above
- Detects bundled VisualVMs automatically, in which case no configuration is necessary
- Should work also with Linux and Mac (not tested, also not sure about 64 bit JVMs)
- Defaults to jdk15 profiler interface for better compatibility (hardcoded)
- Warns about invalid configuration

0.1.0 (2008-11-06)
- Initial release
- CPU profiling (Windows Java 6 only)

Known issues
- VisualVM may freeze if the application finishes execution before its window opens up in VisualVM. A workaround is to add Thread.sleep(1000) or a longer delay to the beginning of the main() method of the profiled application.

Future plans
- A button for opening the currently running (non-profiled) program in VisualVM, so that the user will not need to manually select the program from VisualVM's list of all running Java programs
- Integration with NetBeans IDE's profiler if it has benefits over VisualVM (they both use internally the same NetBeans Profiler)

General usage instructions:

If you have JDK 6 Update 7 or higher configured in IDEA:
1. Click the "Profile CPU" button (next to the "Run" and "Debug" buttons) to begin profiling.

Otherwise you need to install VisualVM separately:
1. Download VisualVM 1.0.1 from https://visualvm.dev.java.net/download.html
2. Install it to "C:/Program Files/visualvm"
3. Configure the plugin (Settings | VisualVM) by pointing it to "C:/Program Files/visualvm"
4. Click the "Profile CPU" button (next to the "Run" and "Debug" buttons) to begin profiling.

Comments:

ORFJackal
Rated: noRate
2010-01-15 01:44:27
Version 1.0.0 of this plugin is not compatible with VisualVM 1.2, and this plugin is not being maintained. Anybody is free to fork the plugin's code at http://github.com/orfjackal/visualvm4idea and continue its maintenance.
.
dsmiley9
Rated:
2010-01-13 17:57:47
It won't run on my Windows machine nor on my Mac. VisualVM comes up, it says something about a taking a snapshot which seems to do nothing, and IntelliJ reports this error:

No response from VisualVM, request was: [PROFILE_CPU, 674030631, 5140, true, com.intellij.rt.execution.junit.JUnitStarter, EXCLUDE, java.*, javax.*,
sun.*, sunw.*, com.sun.*]: No response from VisualVM, request was: [PROFILE_CPU, 674030631, 5140, true, com.intellij.rt.execution.junit.JUnitStarter, EXCLUDE, java.*, javax.*,
sun.*, sunw.*, com.sun.*]
java.lang.RuntimeException: No response from VisualVM, request was: [PROFILE_CPU, 674030631, 5140, true, com.intellij.rt.execution.junit.JUnitStarter, EXCLUDE, java.*, javax.*,
sun.*, sunw.*, com.sun.*]
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.runCommand(VisualVmCommandSender.java:101)
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.beginProfilingApplicationCPU(VisualVmCommandSender.java:74)
at net.orfjackal.visualvm4idea.plugin.CpuProfilerRunner.onProcessStarted(CpuProfilerRunner.java:89)
at net.orfjackal.visualvm4idea.plugin.DefaultJavaProgramRunnerWrapper.doExecute(DefaultJavaProgramRunnerWrapper.java:75)
at net.orfjackal.visualvm4idea.plugin.CpuProfilerRunner.doExecute(CpuProfilerRunner.java:83)
at com.intellij.execution.runners.GenericProgramRunner$1.run(GenericProgramRunner.java:79)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:633)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:57)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:99)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:189)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:228)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.runCommand(VisualVmCommandSender.java:92)
... 17 more
.
Anonymous
Rated: noRate
2009-11-16 21:00:30
Hi,

I am getting following error after clicking "Profile Memory"--

Unable to find profiler agent for JDK16 using ExternalVisualVm10Config[visualVmHome=C:\Program Files\Java\jdk1.6.0_13\lib\visualvm,systemVars=net.orfjackal.visualvm4idea.plugin.config.WindowsSystemVars@53c41ef8]: Unable to find profiler agent for JDK16 using ExternalVisualVm10Config[visualVmHome=C:\Program Files\Java\jdk1.6.0_13\lib\visualvm,systemVars=net.orfjackal.visualvm4idea.plugin.config.WindowsSystemVars@53c41ef8]
java.lang.IllegalArgumentException: Unable to find profiler agent for JDK16 using ExternalVisualVm10Config[visualVmHome=C:\Program Files\Java\jdk1.6.0_13\lib\visualvm,systemVars=net.orfjackal.visualvm4idea.plugin.config.WindowsSystemVars@53c41ef8]
at net.orfjackal.visualvm4idea.plugin.config.AbstractVisualVmConfig.getAppProfilerAgent(AbstractVisualVmConfig.java:71)
at net.orfjackal.visualvm4idea.plugin.server.VisualVmUtil.getAppProfilerCommand(VisualVmUtil.java:69)
at net.orfjackal.visualvm4idea.plugin.MemoryProfilerRunner.patch(MemoryProfilerRunner.java:78)
at net.orfjackal.visualvm4idea.plugin.DefaultJavaProgramRunnerWrapper.doExecute(DefaultJavaProgramRunnerWrapper.java:60)
at net.orfjackal.visualvm4idea.plugin.MemoryProfilerRunner.doExecute(MemoryProfilerRunner.java:83)
at com.intellij.execution.runners.GenericProgramRunner$1.run(GenericProgramRunner.java:79)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:16)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:35)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:99)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:217)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

.
Anonymous
Rated: noRate
2009-10-05 00:19:07
This plugin successfully launches VisualVM and my application (in that order), but my app doesn't appear in the list of apps to profile in VisualVM (under Local). The only app I can profile is VisualVM itself. Sometimes I get a "No response from VisualVM" exception, but not every time. The configuration seems to have worked OK, since the "Startup/Connection" settings appear to be correct. Any ideas?
.
ORFJackal
Rated: noRate
2008-12-19 11:59:22
The "No response from VisualVM" exception is not dangerous. Just a little timeout, because VisualVM did not respond quickly enough.
.
Anonymous
Rated:
2008-12-19 11:31:40
First time I ran it, visualvm needed to callibrate and intellij reported this exception:

No response from VisualVM, request was: [...]
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.runCommand(VisualVmCommandSender.java:100)
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.beginProfilingApplicationCPU(VisualVmCommandSender.java:73)
at net.orfjackal.visualvm4idea.plugin.CpuProfilerRunner.onProcessStarted(CpuProfilerRunner.java:76)
at com.intellij.execution.runners.RunStrategyImpl.a(RunStrategyImpl.java:40)
at com.intellij.execution.runners.RunStrategyImpl.access$200(RunStrategyImpl.java:27)
at com.intellij.execution.runners.RunStrategyImpl$3.run(RunStrategyImpl.java:4)
at com.intellij.execution.impl.ExecutionManagerImpl$1.run(ExecutionManagerImpl.java:16)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:4)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at com.intellij.ide.IdeEventQueue.c(IdeEventQueue.java:39)
at com.intellij.ide.IdeEventQueue.b(IdeEventQueue.java:208)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:214)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: java.util.concurrent.TimeoutException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:228)
at java.util.concurrent.FutureTask.get(FutureTask.java:91)
at net.orfjackal.visualvm4idea.plugin.server.VisualVmCommandSender.runCommand(VisualVmCommandSender.java:91)
... 18 more

Looks nice though
.
ORFJackal
Rated: noRate
2008-11-26 19:33:17
Try if version 0.4.2 fixes that problem. I was not able to reproduce that NPE myself, so I can't verify the fix, but the part which I fixed should be the only possible cause of that NPE.
.
Anonymous
Rated: noRate
2008-11-26 15:40:50
Following exception is shown when trying to run profiler

java.lang.NullPointerException
at net.orfjackal.visualvm4idea.util.StringUtil.splitCommaSeparated(StringUtil.java:45)
at net.orfjackal.visualvm4idea.visualvm.CpuSettings.toProfilingSettings(CpuSettings.java:78)
at net.orfjackal.visualvm4idea.core.commands.ProfileCpuCommand$1.run(ProfileCpuCommand.java:89)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:561)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:986)
.