cloudfoundry / java-buildpack-memory-calculator

Cloud Foundry JVM Memory Calculator
Apache License 2.0
642 stars 70 forks source link

Taking into account frameworks like Dynatrace OneAgent #38

Closed ajaym2402 closed 3 years ago

ajaym2402 commented 3 years ago

Does the memory calculator take into account the overhead memory usage of frameworks such as Dynatrace OneAgent, integrated with the java buildpack? If yes, what memory(memory region in JVM or headroom) is used by such frameworks - so as to be able to tweak that memory's settings?

dmikusa commented 3 years ago

The memory calculator doesn't look at the application directly. All of its inputs come via arguments. It will only make calculations based on the inputs it receives.

The CF Java buildpack will examine your application and use that to configure the --loaded-class-count to memory calculator. The JBP looks in your app to count class files. It will dig through the code and determine how many class files are present. This check happens during the release phase of the buildpack which is after everything has been installed, so the class count will accurately include any class files from software that have been installed by the JBP.

The value determines then gets passed into the memory calculator to determine a reasonable metaspace size.

Beyond that, if the default memory settings calculated by the memory calculator don't work, the app dev will need to set options to adjust them.