Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime agent attach on Windows is very slow when debugging #1437

Open
Trass3r opened this issue Aug 28, 2024 · 3 comments
Open

Runtime agent attach on Windows is very slow when debugging #1437

Trass3r opened this issue Aug 28, 2024 · 3 comments

Comments

@Trass3r
Copy link

Trass3r commented Aug 28, 2024


This line takes forever in my SpringBootApplication when in debug mode, it's fine when running normally.
GraalVM 17.0.12

https://github.com/microsoft/ApplicationInsights-Java/blob/aee3513604c5b56a23acdceabf97aa0f31064dd2/agent/runtime-attach/src/main/java/com/microsoft/applicationinsights/attach/ApplicationInsights.java#L63

Has anyone else experienced this?

@Trass3r
Copy link
Author

Trass3r commented Aug 29, 2024

        at jdk.internal.misc.Unsafe.toUnsignedInt([email protected]/Unsafe.java:3799)
        at jdk.internal.misc.Unsafe.makeInt([email protected]/Unsafe.java:3749)
        at jdk.internal.misc.Unsafe.getIntUnaligned([email protected]/Unsafe.java:3557)
        at jdk.internal.misc.Unsafe.getIntUnaligned([email protected]/Unsafe.java:3565)
        at java.lang.invoke.VarHandleByteArrayAsInts$ArrayHandle.get([email protected]/VarHandleByteArrayAsInts.java:118)
        at java.lang.invoke.VarHandleGuards.guard_LI_I([email protected]/VarHandleGuards.java:163)     <-- hotspot
        at sun.security.provider.ByteArrayAccess.b2iBig64([email protected]/ByteArrayAccess.java:114)
        at sun.security.provider.SHA2.implCompress0([email protected]/SHA2.java:146)
        at sun.security.provider.SHA2.implCompress([email protected]/SHA2.java:122)
        at sun.security.provider.DigestBase.implCompressMultiBlock0([email protected]/DigestBase.java:150)
        at sun.security.provider.DigestBase.implCompressMultiBlock([email protected]/DigestBase.java:144)
        at sun.security.provider.DigestBase.engineUpdate([email protected]/DigestBase.java:131)
        at java.security.MessageDigest$Delegate.engineUpdate([email protected]/MessageDigest.java:658)
        at java.security.MessageDigest.update([email protected]/MessageDigest.java:349)
        at sun.security.util.ManifestEntryVerifier.update([email protected]/ManifestEntryVerifier.java:175)
        at java.util.jar.JarVerifier.update([email protected]/JarVerifier.java:236)
        at java.util.jar.JarVerifier$VerifierStream.read([email protected]/JarVerifier.java:483)
        at java.io.FilterInputStream.read([email protected]/FilterInputStream.java:132)
        at java.io.InputStream.transferTo([email protected]/Unknown Source)
        at java.nio.file.Files.copy([email protected]/Unknown Source)
        at io.opentelemetry.contrib.attach.core.AgentFileProvider.createTempAgentJarFileIn(Unknown Source)
        at io.opentelemetry.contrib.attach.core.AgentFileProvider.getAgentFile(Unknown Source)
        at io.opentelemetry.contrib.attach.core.CoreRuntimeAttach.attachJavaagentToCurrentJvm(Unknown Source)
        at com.microsoft.applicationinsights.attach.ApplicationInsights.attach(Unknown Source)

@trask
Copy link
Member

trask commented Sep 1, 2024

hi @Trass3r!

sun.security.util.ManifestEntryVerifier
...
com.microsoft.applicationinsights.attach.ApplicationInsights

it looks like you're using the applicationinsights-runtime-attach jar, which is signed per Microsoft policy

unfortunately, jar file signature verification is very slow when the JIT compiler is not enabled, which may be what's happening when you're running under the debugger

cc @jeanbisutti @karianna

@laurit
Copy link
Contributor

laurit commented Sep 25, 2024

If things are really slow only when debugger is attached then try deleting all method breakpoints you have, line breakpoints are fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants