This page is no longer maintained — Please continue to the home page at www.scala-lang.org

VisualVM and Scala

2 replies
Tony Sloane
Joined: 2009-01-07,
User offline. Last seen 2 years 32 weeks ago.

Has anyone tried VisualVM 1.2.1 (https://visualvm.dev.java.net) with
Scala apps?

I'm using Scala version 2.7.7.final (Java HotSpot(TM) 64-Bit Server
VM, Java 1.6.0_15) on Mac OS X 10.6.1.

When the tool is instrumenting the running Scala program, I get many
errors of the form

Profiler Agent Error: with message: Redefinition failed with error 69
Check JVMTI documentation for this error code.

The JVMTI documentation (http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#ErrorSection
)
says that this error means

JVMTI_ERROR_NAMES_DONT_MATCH (69)
The class name defined in the new class file is different from the
name in the old class object.

Each occurrence of this error (and there are many) pops up a dialog
box that has to be dismissed manually. Even if the error can be
ignored without affecting the profiling results, it's not practical to
dismiss it this way, so I'd like to remove the error if possible.

Is there any hope of using this tool with Scala? Any recommendations
for Scala profiling tools?

thanks,
Tony

Iulian Dragos 2
Joined: 2009-02-10,
User offline. Last seen 42 years 45 weeks ago.
Re: VisualVM and Scala


On Wed, Nov 11, 2009 at 5:38 AM, Tony Sloane <inkytonik@gmail.com> wrote:

Profiler Agent Error: with message: Redefinition failed with error 69
Check JVMTI documentation for this error code.

The JVMTI documentation (http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#ErrorSection)
says that this error means

JVMTI_ERROR_NAMES_DONT_MATCH (69)
The class name defined in the new class file is different from the name in the old class object.

Probably Scala bytecode does not follow some Java naming convention, but otherwise the error message is quite useless. Have you noticed some pattern on those class names? Are they anonymous functions or top-level objects?

Each occurrence of this error (and there are many) pops up a dialog box that has to be dismissed manually.  Even if the error can be ignored without affecting the profiling results, it's not practical to dismiss it this way, so I'd like to remove the error if possible.

I would file a bug report on VisualVM, it seems like this is not an error the user should be bothered with, especially since things go well from there on.
 

Any recommendations for Scala profiling tools?

I, and a few others in the Scala team, use YourKit. It's free for open-source projects, and works pretty well.

iulian
 

thanks,
Tony




--
« Je déteste la montagne, ça cache le paysage »
Alphonse Allais
Tony Sloane
Joined: 2009-01-07,
User offline. Last seen 2 years 32 weeks ago.
Re: VisualVM and Scala
On 11/11/2009, at 8:35 PM, Iulian Dragos wrote:
On Wed, Nov 11, 2009 at 5:38 AM, Tony Sloane <inkytonik@gmail.com> wrote:

Profiler Agent Error: with message: Redefinition failed with error 69
Check JVMTI documentation for this error code.

The JVMTI documentation (http://java.sun.com/j2se/1.5.0/docs/guide/jvmti/jvmti.html#ErrorSection)
says that this error means

JVMTI_ERROR_NAMES_DONT_MATCH (69)
The class name defined in the new class file is different from the name in the old class object.

Probably Scala bytecode does not follow some Java naming convention, but otherwise the error message is quite useless. Have you noticed some pattern on those class names? Are they anonymous functions or top-level objects?

They appear to be anonymous functions.  At least the list printed out seems to include only those.  Yet, when I pick one, then look at the original class file and the one written by the profiler agent, they seem to be the same, or at least use the same names.  I've run out of time to pursue this at the moment, but later on I may be able to get back to it and see if I can get further.
Each occurrence of this error (and there are many) pops up a dialog box that has to be dismissed manually.  Even if the error can be ignored without affecting the profiling results, it's not practical to dismiss it this way, so I'd like to remove the error if possible.

I would file a bug report on VisualVM, it seems like this is not an error the user should be bothered with, especially since things go well from there on.

Well, it's not entirely clear that things do go well.  Profiling data is produced, but given the errors, who knows exactly which classes are being run.

Any recommendations for Scala profiling tools?

I, and a few others in the Scala team, use YourKit. It's free for open-source projects, and works pretty well.

Thanks, I will take a look at YourKit.
cheers,Tony

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland