Java Threads: Are They Memory Efficient?

Java applications tend to contain hundreds (sometimes thousands) of threads. The majority of these threads are in a WAITING or TIMED_WAITING (i.e., dormant) state, while only a small portion are actively executing lines of code. So, we were curious to know whether dormant threads consume less memory than active threads.

To figure out the answer to this question, we conducted a small study. 

Memory Usage of OpenWhisk Functions

Last week Red Hat introduced the open source framework Quarkus which promises fast boot times and low memory usages. This makes Quarkus interesting for Java workloads running as serverless functions.

I've done a little experiment to compare how much memory functions require which run on Apache OpenWhisk and have been implemented with Java and JavaScript.