cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error with OneAgent using CDS in Spring Boot applications

luis_mpa
Helper

Hello,

We want to generate a CDS file (https://docs.oracle.com/javase/8/docs/technotes/guides/vm/class-data-sharing.html) to improve the startup time of the microservices. When we test without the oneagent we observe the time improvement and reviewing the class load traces "-Xlog:class+load:file=cds.log" we see that it indicates that the classes are obtained from the CDS file ("shared objects").

[2.077s][info][class,load] java.lang.Object source: shared objects file
[2.078s][info][class,load] java.io.Serializable source: shared objects file
[2.078s][info][class,load] java.lang.Comparable source: shared objects file
[2.078s][info][class,load] java.lang.CharSequence source: shared objects file
[2.078s][info][class,load] java.lang.constant.Constable source: shared objects file
[2.078s][info][class,load] java.lang.constant.ConstantDesc source: shared objects file
[2.078s][info][class,load] java.lang.String source: shared objects file
[2.079s][info][class,load] java.lang.reflect.AnnotatedElement source: shared objects file
[2.079s][info][class,load] java.lang.reflect.GenericDeclaration source: shared objects file
[2.079s][info][class,load] java.lang.reflect.Type source: shared objects file
[2.080s][info][class,load] java.lang.invoke.TypeDescriptor source: shared objects file
[2.080s][info][class,load] java.lang.invoke.TypeDescriptor$OfField source: shared objects file
[2.080s][info][class,load] java.lang.Class source: shared objects file
.....

But when we run with the oneagent we see the following traces that indicate that the classes of the CDS file are not loaded and we do not observe the time improvements.


[0.449s][info][class,load] opened: /opt/dynatrace/oneagent/agent/bin/1.277.196.20231124-110751/any/java/oneagentjava.jar
[0.449s][info][class,load] opened: /opt/dynatrace/oneagent/agent/bin/1.277.196.20231124-110751/any/java/oneagentjava.8.jar
[0.449s][info][class,load] opened: /opt/dynatrace/oneagent/agent/bin/1.277.196.20231124-110751/any/java/oneagentjava.11.jar
[0.449s][info][class,load] opened: /opt/dynatrace/oneagent/agent/bin/1.277.196.20231124-110751/any/java/oneagentjava.17.jar
[0.453s][info][class,load] java.lang.Object source: jrt:/java.base
[0.453s][info][class,load] java.io.Serializable source: jrt:/java.base
[0.454s][info][class,load] java.lang.Comparable source: jrt:/java.base
[0.454s][info][class,load] java.lang.CharSequence source: jrt:/java.base
[0.454s][info][class,load] java.lang.constant.Constable source: jrt:/java.base
[0.454s][info][class,load] java.lang.constant.ConstantDesc source: jrt:/java.base
[0.454s][info][class,load] java.lang.String source: jrt:/java.base
......


We have tried to generate the CDS file with the oneagent agent, but it returns the following error:

sh-4.4$ java -Dspring.context.exit=onRefresh -XX:ArchiveClassesAtExit=application.jsa -jar run-app.jar
Error occurred during CDS dumping
CDS dumping does not support native JVMTI agent, name: /opt/dynatrace/oneagent/agent/bin/1.277.196.20231124-110751/linux-x86-64/liboneagentloader.so

We would like to know if there is a way to load classes with CDS together with the oneagent agent.

Thanks & regards

0 REPLIES 0

Featured Posts