Scrivio Interview library
LeadershipPrincipal7 min read · updated 12 November 2026

Application servers in the 2000s hosted many applications in one JVM, isolated by per-application class loaders. Today most companies run one application per JVM or container. Explain why this shift happened and what it means when a team now proposes in-process plugin or multi-tenant hosting.

Shared application servers made sense when hardware and licences were expensive and JVMs started slowly, but class loader isolation was leaky: redeploys leaked memory, library versions clashed, and nothing stopped one application from starving or crashing the rest. Containers made one process per application cheap and gave operating system level isolation, and with the Security Manager disabled from JDK 24 the JVM no longer offers an in-process sandbox. So a new proposal for in-process plugins or multi-tenant hosting needs a strong latency or footprint case and trusted, co-released code; otherwise process isolation is the default.

Why this question is asked

Every few years a team rediscovers the idea of loading many things into one JVM: a plugin platform, a multi-tenant rules engine, a shared worker that runs many customers' jobs. Senior engineers are expected to recognise the pattern, remember why the industry moved away from it, and judge whether this proposal is different. Interviewers ask this to see whether we can turn history into a decision rule rather than a reflex. In this answer, we will recap how the old application servers isolated applications, see what went wrong in practice, explain what containers changed, and then work through how a senior person evaluates a new in-process proposal, with an example.

1How Application Servers Isolated Applications

In the 2000s, a typical enterprise ran a handful of large application servers, such as WebSphere, WebLogic or JBoss, and deployed many applications into each one as WAR and EAR files. All applications shared one JVM. Each got its own class loader, so its classes and libraries were kept apart from the others by the rules of class identity: the same class name in two loaders is two different types.

The reasons were economic. A server with 4 GB of memory was expensive, commercial servers were often licensed per CPU or per instance, and a JVM took tens of seconds to start and warm up. Packing twenty applications into one JVM shared the cost of the server, its licence, the JDK's own classes and the JIT's warm-up across all of them.

2Why Class Loader Isolation Was Leaky

Class loaders isolate types, and nothing else. In practice, three problems kept recurring. The first was redeploy leaks: undeploying an application required every reference to its class loader to disappear, but a thread it started, a ThreadLocal on a server thread, or a JDBC driver registered in DriverManager kept the loader alive, so after enough redeploys the server ran out of PermGen or metaspace and had to be restarted anyway.

The second was version conflicts. Libraries in the server's shared directories clashed with versions inside the applications, producing ClassCastException between two copies of a class, NoSuchMethodError, or loader constraint errors, and every server had its own delegation rules to learn. The third was the absence of resource and failure isolation. One application with a memory leak caused OutOfMemoryError for all twenty, one runaway loop starved the others of CPU, one deadlock on a shared pool hung them all, and patching the JVM meant a maintenance window for every team at once.

3What Containers Changed

Virtual machines and then containers changed the economics. A container gives a process its own file system, memory limit, CPU quota and network identity, enforced by the operating system kernel, and starting one costs little more than starting the process inside it. Orchestrators such as Kubernetes restart failed processes, roll out new versions gradually and pack many small processes onto large hosts. JVMs became container aware, and start-up improved through class data sharing and, more recently, the JDK's AOT cache.

With one application per JVM per container, every leak and conflict above disappears or becomes local. A redeploy replaces the process, so nothing can leak across versions. Each application has exactly one set of libraries. A memory leak kills only its own container, which is restarted. The cost moved from operational risk to some duplicated memory per JVM, and that duplication became cheap compared with the cost of incidents.

Shared application server versus one application per container
ConcernShared JVM, loader per appOne app per container
Memory costlower, shared JDK and serverhigher, a JVM per app
Library conflictsfrequent, server-specific rulesone class path per app
Redeployleaks the old loaderreplaces the process
Memory and CPU limitsnone per appenforced by the kernel
Crash isolationone failure affects allone container restarts
Security boundarySecurity Manager, now goneOS user, namespaces, policies

4The Security Manager Is Gone

Part of the old model relied on the Security Manager to stop one application from reading another's files or calling System.exit. It was deprecated for removal in JDK 17 and is permanently disabled from JDK 24, so the JVM no longer offers any in-process sandbox. Strong module encapsulation stops accidental use of internals, but code running in our process can still do anything the process can do. Any proposal that runs code from other teams' customers, or anything less trusted than the host, in the same JVM is therefore a security decision, not just an engineering one.

5How to Evaluate a New In-Process Proposal

When a team proposes in-process plugins or multi-tenant hosting, the senior job is not to reject it from memory of WebSphere, but to ask whether the reasons that once justified sharing apply now, and whether the team has answers for the known failure modes. A useful sequence of questions is the one below.

Step throughDeciding on in-process hosting
  1. Is the code fully trusted and released with the host?
    YesContinueNoRun it out of process
  2. Is there a measured latency or footprint need?
    YesContinueNoUse one process per unit
  3. Can we avoid hot unloading?restart the host to upgrade
    YesIn-process with limitsNoPlan for loader leaks
  4. Bound and observe each plugintimeouts, executors, allocation per thread

4 steps in order. Play them, or step through them one at a time.

Each answer of no pushes the design back towards process isolation.

Consider an example. A pricing team wants to host 400 customer-specific pricing rules as plugins in one JVM, because each rule is called inside a request that must answer in 5 milliseconds and an RPC per rule would cost 1 millisecond. The rules are written by the pricing team itself and released with the host every two weeks. Here the latency case is measured, the code is trusted and co-released, so there is no hot unloading. In-process is reasonable, provided the team bounds each rule's work with timeouts, runs rules on host-managed executors and load-tests the worst rule.

Now change one fact: the rules are uploaded by customers. The latency argument is unchanged, but the trust answer is no, so the rules must run out of process, perhaps in a pool of sandboxed workers with batched calls to win back latency, or in a restricted expression language that cannot do arbitrary things.

6Follow-up questions

What evidence would make you approve an in-process design?

Measured numbers, not intuition: a latency budget that an RPC per call would break, shown with a prototype, or a memory footprint per process that makes hundreds of separate JVMs unaffordable. Evidence that the code is trusted and released with the host, so no untrusted code and no hot unloading in production. A plan for the known failure modes, with timeouts, bounded resources and per-plugin metrics. And a load test showing that the worst plugin cannot degrade the others beyond an agreed limit. Without these, I would ask for process isolation and revisit if measurements later justify it.

Does one JVM per application waste too much memory?

It costs more, typically a few tens to a few hundred megabytes of fixed overhead per JVM for metaspace, code cache, threads and the JDK's own classes, but class data sharing and the AOT cache reduce the shared part, and memory is cheap compared with the cost of one shared-server outage. For very small services we can also choose smaller heaps, fewer threads, or native images.

Is multi-tenancy in one JVM always wrong?

No. Serving many tenants from one application, where tenants are data rather than code, is normal and safe if the code enforces tenant boundaries. The risk discussed here is running different code per tenant in one process. That is where the old application server problems return.

7Conclusion

In this answer, we saw that shared application servers saved hardware, licences and warm-up time, but that class loader isolation separated only types: redeploys leaked loaders, library versions clashed, and nothing limited one application's memory, CPU or failures. Containers made one process per application cheap and moved isolation into the operating system, and the Security Manager's removal took away the last in-process sandbox. So today an in-process plugin or multi-tenant design must earn its place with measured latency or footprint needs and trusted, co-released code, and otherwise we prefer process isolation.

What to say in the interviewAbout 90 seconds aloud

Open with

Twenty years ago we put many applications into one application server because hardware and licences were expensive and JVMs were slow to start, so sharing one JVM saved real money.

Then, if they want more

Isolation came from a class loader per application, but that only separates types.

In practice redeploys leaked old loaders through threads, ThreadLocals or JDBC drivers until the server ran out of PermGen or metaspace, shared libraries clashed with application versions and gave ClassCastException or NoSuchMethodError, and there was no memory, CPU or crash isolation, so one leaking application took down all of them.

Containers changed the economics: one process per application became cheap, the kernel enforces memory and CPU limits, a crash restarts one container, and a deploy simply replaces the process, so nothing leaks across versions. Also the Security Manager is permanently disabled from JDK 24, so the JVM cannot sandbox in-process code at all.

So when a team proposes in-process plugins or multi-tenant hosting, I ask whether the code is trusted and released together with the host, whether there is a measured latency or footprint need that an RPC would break, and whether they can avoid hot unloading. If all three are yes, I would accept it with timeouts, bounded executors and per-plugin metrics. If the code is untrusted, it goes out of process regardless of latency.

About this answer

Last updated
12 November 2026
Versions it names
Java 24, Java 17
Checked
Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
Where the question comes from
Written by Scrivio for practice. It is not taken from an interview.
Report an issue with this answer

Copy the line below and send it to the author with what you found. It carries the address of this page.

Issue with "Application servers in the 2000s hosted many applications in one JVM, isolated by...": https://scrivio-interview-library.netlify.app/java/class-loading/5d162bda79/