Java 11 support

Questions about YourKit Java Profiler
Locked
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

Please don't forget that YourKit license offers 1 year of free upgrades, and that it never expires unlike a subscription based licensing very popular with other vendors nowadays. Everyone who purchased the license or renewed it less than a year before the release upgrade for free.
grogozinsky
Posts: 7
Joined: Thu Nov 01, 2018 12:56 am

Re: Java 11 support

Post by grogozinsky »

I have upgraded to a new major version supporting JDK11 and now I have major problems.
First, when I add YKJ agent on server startup it doesn't seem to work. I don't see my application under "Connection" section. When I click on my application name under "Local Applications" section it appears under "Connection" with after a small delay, but I the CPU time shown when I start CPU Profiling with default sampling option is completely off (significanly smaller than a real time) and when I start CPU Profiling with tracing option time most of time it takes forever and I get an error that tracing is not available or some time it comes and time is significantly higher and most of time taken is shown from Logger.info.
With all of it the profiling is pretty much pointless for me. Previous version work much better.
Do you have any suggestions?
Here is how I start the profiler:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -agentpath:C:\ProgramData\YourKit\2019.1.110.04084DAD\64\yjpagent.dll=disablestacktelemetry,exceptions=disable,delay=10000
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

Could you please send the profiler agent log file to [email protected]
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

I don't see my application under "Connection" section. When I click on my application name under "Local Applications" section it appears under "Connection" with after a small delay,
Is your application local or remote? If it's local, why do you expect to see it in remote connections?
but I the CPU time shown when I start CPU Profiling with default sampling option is completely off (significanly smaller than a real time)
Please try to add the line
-Dyjp.zero.time.methods=false
to <user home>/.yjp/ui.ini
If this doesn't help please provide a snapshot file demonstrating the problem.
and when I start CPU Profiling with tracing option time most of time it takes forever
Do you mean it takes forever to start CPU tracing (do you see a progress saying the classes are being retransformed?) or is the profiled application extremely slow with it?
and I get an error that tracing is not available
Could you please provide the exact error message.
or some time it comes and time is significantly higher and most of time taken is shown from Logger.info.
CPU tracing overhead may be significant, it's expected.
With all of it the profiling is pretty much pointless for me. Previous version work much better.
What previous version do you mean?
Here is how I start the profiler:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -agentpath:C:\ProgramData\YourKit\2019.1.110.04084DAD\64\yjpagent.dll=disablestacktelemetry,exceptions=disable,delay=10000
Please note you enable debugger at the same time. Please check whether running without debugger makes a difference.
grogozinsky
Posts: 7
Joined: Thu Nov 01, 2018 12:56 am

Re: Java 11 support

Post by grogozinsky »

Below are my answers inline in BOLD.
I don't see my application under "Connection" section. When I click on my application name under "Local Applications" section it appears under "Connection" after a small delay,
Is your application local or remote? If it's local, why do you expect to see it in remote connections?

My application is using spring-boot with embedded jetty container and YKJ agent is passed in JVM arguments and is remote, but in this particular case I was starting it on my local machine.

but the CPU time shown when I start CPU Profiling with default sampling option is completely off (significanly smaller than a real time)

Please try to add the line
-Dyjp.zero.time.methods=false
to <user home>/.yjp/ui.ini

Actually, I upgraded yesterday to build 111 and timing with sampling is much closer to the real one.

If this doesn't help please provide a snapshot file demonstrating the problem.
and when I start CPU Profiling with tracing option time most of time it takes forever

Do you mean it takes forever to start CPU tracing (do you see a progress saying the classes are being retransformed?) or is the profiled application extremely slow with it?
and I get an error that tracing is not available
Could you please provide the exact error message.
It takes forever to start CPU tracing and a lot of time it failes. I will provide a message next time it happens.

or some time it comes and time is significantly higher and most of time taken is shown from Logger.info.
CPU tracing overhead may be significant, it's expected.
With all of it the profiling is pretty much pointless for me. Previous version work much better.
What previous version do you mean?

The last early access build (I think it was 2018.5.90) worked much better in all aspects.

Here is how I start the profiler:
mvn spring-boot:run -Dspring-boot.run.jvmArguments="-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 -agentpath:C:\ProgramData\YourKit\2019.1.110.04084DAD\64\yjpagent.dll=disablestacktelemetry,exceptions=disable,delay=10000
Please note you enable debugger at the same time. Please check whether running without debugger
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

It takes forever to start CPU tracing and a lot of time it failes. I will provide a message next time it happens.
Yes, please. We'll also need the log file(s).
The last early access build (I think it was 2018.5.90) worked much better in all aspects.
"In all aspects" is too broad. We can investigate only particular issues.

Please provide all necessary detail on each issue you experience: log files, screenshot of errors, etc. Otherwise we cannot help.
sandreev
Posts: 1
Joined: Thu Sep 10, 2020 12:12 pm

Re: Java 11 support

Post by sandreev »

Just to double check whether this is expected:

YourKit Java Profiler 2019.8-b141 cannot run on Java 11.0.8, it requires Java 8.
(Note: this applies only to running YourKit Java Profiler itself. Your applications may run on Java 7 or newer.)

In this thread, statements are made in 2018, that an early access build fixes the problem? What build would that be, if the fix is not included in a 2019.8 release?
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

The current version 2020.7 runs on Java 11 itself and allows profiling of Java versions from Java 7 to Java 14.
dinesh
Posts: 1
Joined: Tue Jan 31, 2023 10:38 am

Re: Java 11 support

Post by dinesh »

Hi Team,

I'm using weblogic 14c & jdk 11 combination stack, while i'm starting the server by placing yourkit arguments, Jvm is not getting started and its thowing error, By defaukt JFR doing instrumentation on weblogic classes. Is there any arguments I need to pass additionally to stop JFR instrumentation?


Below is the error stack trace

[8.838s][error][jfr,system] JfrJvmtiAgent::retransformClasses failed

<Jan 3, 2023, 9:42:14 AM Greenwich Mean Time> <Critical> <WebLogicServer> <BEA-000362> <Server failed. Reason:
There are 1 nested errors:
java.lang.ExceptionInInitializerError

at weblogic.diagnostics.instrumentation.InstrumentationManager.getInstrumentationManager(InstrumentationManager.java:198)

at weblogic.diagnostics.instrumentation.rtsupport.InstrumentationSupportImpl.getMonitor(InstrumentationSupportImpl.java:73)

at weblogic.diagnostics.instrumentation.rtsupport.InstrumentationSupportImpl.getMonitor(InstrumentationSupportImpl.java:58)

at weblogic.diagnostics.instrumentation.InstrumentationSupport.getMonitor(InstrumentationSupport.java:462)

at weblogic.ejb.container.internal.BaseRemoteObject.<clinit>(BaseRemoteObject.java)

at java.base/java.lang.Class.forName0(Native Method)

at java.base/java.lang.Class.forName(Class.java:398)

at weblogic.t3.srvr.FinalThreadLocalService.start(FinalThreadLocalService.java:47)

at weblogic.server.AbstractServerService.postConstruct(AbstractServerService.java:76)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.base/java.lang.reflect.Method.invoke(Method.java:566)

at org.glassfish.hk2.utilities.reflection.ReflectionHelper.invoke(ReflectionHelper.java:1268)

at org.jvnet.hk2.internal.ClazzCreator.postConstructMe(ClazzCreator.java:309)

at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:351)

at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)

at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)

at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)

at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)

at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)

at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:678)

at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:54)

at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:188)

at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:211)

at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)

at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)

at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)

at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)

at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)

at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)

at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:678)

at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:54)

at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:188)

at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:211)

at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)

at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)

at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)

at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)

at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)

at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)

at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:678)

at org.jvnet.hk2.internal.ThreeThirtyResolver.resolve(ThreeThirtyResolver.java:54)

at org.jvnet.hk2.internal.ClazzCreator.resolve(ClazzCreator.java:188)

at org.jvnet.hk2.internal.ClazzCreator.resolveAllDependencies(ClazzCreator.java:211)

at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:334)

at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)

at org.glassfish.hk2.runlevel.internal.AsyncRunLevelContext.findOrCreate(AsyncRunLevelContext.java:281)

at org.glassfish.hk2.runlevel.RunLevelContext.findOrCreate(RunLevelContext.java:65)

at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)

at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:93)

at org.jvnet.hk2.internal.ServiceHandleImpl.getService(ServiceHandleImpl.java:67)

at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.oneJob(CurrentTaskFuture.java:1213)

at org.glassfish.hk2.runlevel.internal.CurrentTaskFuture$QueueRunner.run(CurrentTaskFuture.java:1144)

at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)

at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)

at java.base/java.lang.Thread.run(Thread.java:834)

Caused by: A MultiException has 2 exceptions. They are:

1. java.lang.ClassFormatError: JfrJvmtiAgent::retransformClasses failed

2. java.lang.IllegalStateException: Unable to perform operation: create on weblogic.diagnostics.instrumentation.InstrumentationManager


at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:368)

at org.jvnet.hk2.internal.SystemDescriptor.create(SystemDescriptor.java:463)

at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:59)

at org.jvnet.hk2.internal.SingletonContext$1.compute(SingletonContext.java:47)

at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture$1.call(Cache.java:74)

at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)

at org.glassfish.hk2.utilities.cache.Cache$OriginThreadAwareFuture.run(Cache.java:131)

at org.glassfish.hk2.utilities.cache.Cache.compute(Cache.java:176)

at org.jvnet.hk2.internal.SingletonContext.findOrCreate(SingletonContext.java:98)

at org.jvnet.hk2.internal.Utilities.createService(Utilities.java:2102)

at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:757)

at org.jvnet.hk2.internal.ServiceLocatorImpl.internalGetService(ServiceLocatorImpl.java:720)

at org.jvnet.hk2.internal.ServiceLocatorImpl.getService(ServiceLocatorImpl.java:690)

at weblogic.utils.LocatorUtilities.getService(LocatorUtilities.java:37)

at weblogic.diagnostics.instrumentation.InstrumentationManager$InstrumentationManagerInitializer.<clinit>(InstrumentationManager.java:73)

... 57 more

Caused by: java.lang.ClassFormatError: JfrJvmtiAgent::retransformClasses failed

at jdk.jfr/jdk.jfr.internal.JVM.$$YJP$$retransformClasses(Native Method)

at jdk.jfr/jdk.jfr.internal.JVM.retransformClasses(JVM.java)

at jdk.jfr/jdk.jfr.internal.instrument.JDKEvents.addInstrumentation(JDKEvents.java:126)

at jdk.jfr/jdk.jfr.internal.PlatformRecorder.<init>(PlatformRecorder.java:82)

at jdk.jfr/jdk.jfr.FlightRecorder.getFlightRecorder(FlightRecorder.java:182)

at weblogic.diagnostics.flightrecorder.impl.FlightRecorderManagerV2Impl.isRecordingPossible(FlightRecorderManagerV2Impl.java:215)

at weblogic.diagnostics.instrumentation.DiagnosticMonitorControl.<init>(DiagnosticMonitorControl.java:115)

at weblogic.diagnostics.instrumentation.StandardMonitorControl.<init>(StandardMonitorControl.java:25)

at weblogic.diagnostics.instrumentation.DelegatingMonitorControl.<init>(DelegatingMonitorControl.java:45)

at weblogic.diagnostics.instrumentation.InstrumentationLibrary.getDiagnosticMonitorControl(InstrumentationLibrary.java:369)

at weblogic.diagnostics.instrumentation.InstrumentationLibrary.getAllAvailableMonitors(InstrumentationLibrary.java:339)

at weblogic.diagnostics.instrumentation.InstrumentationManager.getAvailableMonitors(InstrumentationManager.java:358)

at weblogic.diagnostics.instrumentation.InstrumentationManager.<init>(InstrumentationManager.java:154)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)

at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)

at org.glassfish.hk2.utilities.reflection.ReflectionHelper.makeMe(ReflectionHelper.java:1356)

at org.jvnet.hk2.internal.ClazzCreator.createMe(ClazzCreator.java:248)

at org.jvnet.hk2.internal.ClazzCreator.create(ClazzCreator.java:342)

... 71 more
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Re: Java 11 support

Post by Anton Katilin »

It seems your question is about JFR agent, not YourKit Java Profiler agent.
Locked