Package org.agrona.agent
Class BufferAlignmentAgent
java.lang.Object
org.agrona.agent.BufferAlignmentAgent
A Java agent that verifies that all memory accesses in
DirectBuffer
implementations are aligned.
Unaligned accesses can be slower or even make the JVM crash on some architectures.
Using this agent will avoid such crashes, but it has a performance overhead and should only be used for testing and debugging.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static net.bytebuddy.agent.builder.ResettableClassFileTransformer
private static Instrumentation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
agent
(boolean shouldRedefine, Instrumentation instrumentation) static void
agentmain
(String agentArgs, Instrumentation instrumentation) Invoked when the agent is attached to an already running application.static void
premain
(String agentArgs, Instrumentation instrumentation) Invoked when the agent is launched with the JVM and before the main application.static void
Remove the bytecode transformer and associated bytecode weaving so the alignment checks are not made.
-
Field Details
-
alignmentTransformer
private static net.bytebuddy.agent.builder.ResettableClassFileTransformer alignmentTransformer -
instrumentation
-
-
Constructor Details
-
BufferAlignmentAgent
private BufferAlignmentAgent()
-
-
Method Details
-
premain
Invoked when the agent is launched with the JVM and before the main application.- Parameters:
agentArgs
- ignored for buffer alignment agent.instrumentation
- for adding bytecode to classes.
-
agentmain
Invoked when the agent is attached to an already running application.- Parameters:
agentArgs
- ignored for buffer alignment agent.instrumentation
- for adding bytecode to classes.
-
agent
-
removeTransformer
public static void removeTransformer()Remove the bytecode transformer and associated bytecode weaving so the alignment checks are not made.
-