paketo-buildpacks / libjvm

A library and helper applications that form the basis for building the different Paketo-style JVM-providing buildpacks
Apache License 2.0
19 stars 20 forks source link

[memory_calculator] Counting classes from classpath #348

Open qiaoleiatms opened 9 months ago

qiaoleiatms commented 9 months ago

Currently, the calculation of metaspace size depends on the class count of JVM, application, agent and the adjustment (static/factor)

totalClasses := float64(jvmClassCount+appClassCount+agentClassCount+staticAdjustment) * (float64(adjustmentFactor) / 100.0)

But the 3rd party libraries introduced from classpath are no included, for example, below is a screenshot from a tomcat app:

image

Expected Behavior

Should take the libraries from classpath into count

Current Behavior

Not included

Steps to Reproduce

pack build a war project such as spring-framework-petclinic with the paketo java buildpacks

Motivations

The metaspace size may not correct or enough for a java project which introduces libraries with a large size from classpath