Does your old Java configuration fail to start on Java 17? The answer is in how the JVM uses memory.
In Java, each thread has its own stack for local variables. Objects live on the heap, the area the garbage collector cleans up. Class data lives in the Metaspace, outside the heap. The JVM also uses other memory areas that are easy to forget.
Three areas you need to know Memory of a Java process: thread stacks, the heap, the Metaspace and other native memory areas Java process everything outside the heap is native memory Stacks one per thread · -Xss Thread main process() · client main() Thread 2 read() run() frames, local variables Heap shared · managed by the GC · -Xmx Client String List byte[] objects created with new interned strings static fields Metaspace native memory no limit by default Client fields, methods… String fields, methods… class descriptions -XX:MaxMetaspaceSize Also in native memory Code cache machine code from the JIT up to 240 MB by default Direct memory ByteBuffer.allocateDirect() -XX:MaxDirectMemorySize Internal data garbage collector, compiler and more The stack: one per thread Each thread gets its own stack. Every method call adds a frame to it, with the method’s parameters and local variables. When the method returns, its frame is gone. The garbage collector is not needed to free this memory.
...