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(java.base@17.0.12/Unsafe.java:3799)
        at jdk.internal.misc.Unsafe.makeInt(java.base@17.0.12/Unsafe.java:3749)
        at jdk.internal.misc.Unsafe.getIntUnaligned(java.base@17.0.12/Unsafe.java:3557)
        at jdk.internal.misc.Unsafe.getIntUnaligned(java.base@17.0.12/Unsafe.java:3565)
        at java.lang.invoke.VarHandleByteArrayAsInts$ArrayHandle.get(java.base@17.0.12/VarHandleByteArrayAsInts.java:118)
        at java.lang.invoke.VarHandleGuards.guard_LI_I(java.base@17.0.12/VarHandleGuards.java:163)     <-- hotspot
        at sun.security.provider.ByteArrayAccess.b2iBig64(java.base@17.0.12/ByteArrayAccess.java:114)
        at sun.security.provider.SHA2.implCompress0(java.base@17.0.12/SHA2.java:146)
        at sun.security.provider.SHA2.implCompress(java.base@17.0.12/SHA2.java:122)
        at sun.security.provider.DigestBase.implCompressMultiBlock0(java.base@17.0.12/DigestBase.java:150)
        at sun.security.provider.DigestBase.implCompressMultiBlock(java.base@17.0.12/DigestBase.java:144)
        at sun.security.provider.DigestBase.engineUpdate(java.base@17.0.12/DigestBase.java:131)
        at java.security.MessageDigest$Delegate.engineUpdate(java.base@17.0.12/MessageDigest.java:658)
        at java.security.MessageDigest.update(java.base@17.0.12/MessageDigest.java:349)
        at sun.security.util.ManifestEntryVerifier.update(java.base@17.0.12/ManifestEntryVerifier.java:175)
        at java.util.jar.JarVerifier.update(java.base@17.0.12/JarVerifier.java:236)
        at java.util.jar.JarVerifier$VerifierStream.read(java.base@17.0.12/JarVerifier.java:483)
        at java.io.FilterInputStream.read(java.base@17.0.12/FilterInputStream.java:132)
        at java.io.InputStream.transferTo(java.base@17.0.12/Unknown Source)
        at java.nio.file.Files.copy(java.base@17.0.12/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