Skip to content

Memory issues

Jean Bisutti edited this page Apr 26, 2023 · 1 revision

Below we describe a tool to do RSS (resident-set size) and native memory tracking measures. These measures can be complementary to a heap dump.

Download memory-agent-1.jar.

After, start the application with and without the Application Insights with the following configurations:

1)  

-javaagent:memory-agent-1.jar -Dapplicationinsights.diagnostics.mem.duration-in-s=1000 -Dapplicationinsights.diagnostics.mem.interval-in-ms=5000 -Dapplicationinsights.diagnostics.mem.rss=true -XX:+AlwaysPreTouch

  2)

-javaagent:memory-agent-1.jar -Dapplicationinsights.diagnostics.mem.duration-in-s=1000 -Dapplicationinsights.diagnostics.mem.interval-in-ms=10000 -Dapplicationinsights.diagnostics.mem.ntm=true -XX:NativeMemoryTracking=summary -XX:+AlwaysPreTouch

⚠️ The Application Insights agent has to be declared after memory-agent-1.jar, for example:

-javaagent:memory-agent-1.jar -javaagent:applicationinsights-agent-<version>.jar

Each time, the measures will take applicationinsights.diagnostics.mem.duration-in-s seconds. The tool will display a message on the console to indicate the location of the zip file containing the results. Example:

image

You can adjust the value of applicationinsights.diagnostics.mem.duration-in-s to a duration for which you estimate the memory level should have reached its maximum value.