Not at all. Java the language is not heavyweight (your smart cards and sim cards run Java code inside them!), and the regular JVM can run on pretty low resources.
It's the frameworks and architectural decisions that make Java software feel heavy or light. Very much like with JavaScript, for instance.
Back at some previous job, we ran a lot of small services written in Java; a service consuming 50 MB of heap was considered unusually heavy.
Java unfairly has been given a bad rep since its earlier versions (similar to how PHP still is tainted by its SQL injection vulnerabilities pre PHP7)
Java as you know is translated into byte code and then it is up to the compiler to use JIT compilation when running the code.
JIT allows flexibility to choose how to optimise linkers and references to other libraries which means that it can choose how to optimise the code after Run 1, 10, 100.
Some Java VMs can decide to optimise "fast startup" vs "fast runtime".
This is a nice flexibility and with Java maturing into Java 17 there are more and more optimisations on the horizon for VMs, GC and precompiling dependencies.
I've always thought like you... Until using OneDev.
For me, Java was :
- slow and heavyweight
- dist directory often a fucking mess
OneDev distribution (docker container or zip for baremetal) is clean and very well organized. There are running scripts for both plateform linux/windows. Fast.
It's the frameworks and architectural decisions that make Java software feel heavy or light. Very much like with JavaScript, for instance.
Back at some previous job, we ran a lot of small services written in Java; a service consuming 50 MB of heap was considered unusually heavy.