# A Java or .NET app needs a memory setting. We set it.

> Managed Java and .NET hosting. Spring, ASP.NET Core and Kotlin run on a dedicated server at a fixed rate. CodeHerder ships your runtime upgrades.

Source: https://customhosted.com/host/dotnet-java/

№ 01 What we host

A Java or .NET app runs as one long-lived process. The runtime decides how much memory that process may use. On a small server, its default is often wrong. We check it when we set the app up.

Revised 29 Nov 2026

When this isn't the right fit Is your app a .NET Framework app? It needs Windows, which is a custom quote. Or CustomLabs ports it to current .NET, and CodeHerder ships the follow-up changes.

№ 02 The requirements

## What it needs to run

The shape of the workload, before any hosting decision gets made.

- **Runtime**: A JVM, or current .NET, installed and patched on the instance
- **Build step**: Maven, Gradle or dotnet publish, in the pipeline
- **Standing process?**: Yes: one service, kept alive by a service manager
- **Data store**: Usually: a managed database tier
- **Verdict**: Dedicated M, with a memory limit set on purpose

№ 03 How it runs

## How it runs here

The same management as every other tier we run, written in .NET & Java's own terms.

- Provisioning — A dedicated instance with the runtime your app targets, a service manager and a static IP. We set the memory limit for the runtime when we set up the instance.
- Deploys — Push to main. The pipeline builds and tests the app, copies the package to the instance and restarts the process. Then it checks that the app answers.
- Data + backups — Add a managed database tier and it backs up every night, like every other stack. Files the app writes to disk back up with the database, on the same nightly schedule.
- TLS / DNS / monitoring — A proxy ends TLS and forwards plain requests to your port. Certificates renew on their own and we manage DNS end to end. Monitoring restarts a crashed process and alerts a person if it keeps failing. — [What a visitor sees during a restart →](https://customhosted.com/what-visitors-see)

№ 04 Moving it in

## Moving it in

Already running somewhere else? The full [migration playbook](https://customhosted.com/migrate) covers the general steps. Below is what is specific to .NET & Java.

1. 1 — Point us at the repo — We need read access to the repo, your build command, the runtime version you target and the config the app reads at start.
2. 2 — We stand up a copy — We build the package in the pipeline, run it under the service manager and check it on a staging copy first.
3. 3 — Cutover on your schedule — DNS and TLS switch over with little-to-no downtime. A rollback stays ready if anything looks wrong.

The real gotchas

- A JVM caps its heap at a quarter of the instance memory unless you say otherwise. The app can run out of heap while the instance shows memory free. Set the limit on purpose.
- Leave room outside the heap. The JVM also needs memory for class metadata, thread stacks and the operating system. Do not give the heap all of the RAM.
- A .NET app picks its own garbage collector mode. Set a heap limit in the runtime config file. The matching environment variable is read as hexadecimal. A value of 50 sets a limit of 80 percent.
- Build in the pipeline, not on the instance. Maven, Gradle and the .NET SDK need more memory than the finished app does.

№ 05 The loop

## The loop, on .NET & Java

Java and .NET apps live for years. The work is mostly upgrades: a new runtime, a new framework version, a library with a security fix. Each one is long, dull and easy to check with a build and a test suite.

1. 01 — Build — CustomLabs — Bring a Java or .NET app you already built. Or CustomLabs designs and builds the first version.
2. 02 — Iterate — CodeHerder — Brief a runtime move, a framework upgrade or a dependency fix in plain language. An agent opens a pull request against the real repo. A person reviews it.
3. 03 — Run — CustomHosted — One service on one dedicated instance, with a managed database. We patch the instance on a schedule.

An example brief

- **The brief**: Move the service to the next long-term-support Java release. Fix what no longer compiles.
- **What the pull request holds**: The build file change and a fix for each compile error, in one pull request. CI builds the package and runs your tests on the new runtime. A person reviews it before it merges.
- **What happens next**: [A human reviews and merges](https://customhosted.com/review). [It ships through the same pipeline](https://customhosted.com/deploys).
- **A real one**: [The site is blinding at night](https://customhosted.com/case-files#cf-01) (+751 −258 · 19 files · merged 2026-07-31).

№ 06 What the runtime takes by default

## What the runtime takes by default

A JVM with no memory flag uses 25% of the instance RAM for its heap. The table shows that cap for each dedicated plan.

| Plan | RAM | Default heap | Left for the rest |
| --- | --- | --- | --- |
| Dedicated S | 1 GB | 256 MB | 768 MB |
| Dedicated M | 2 GB | 512 MB | 1536 MB |
| Dedicated L | 4 GB | 1024 MB | 3072 MB |

The app can throw `OutOfMemoryError` while the instance shows most memory free. The heap is full, and the rest is idle. Set `-XX:MaxRAMPercentage` or `-Xmx` on purpose. Leave room for class metadata, thread stacks and the operating system.

.NET works the other way. It sizes its own garbage collector, and a small instance can hold more memory than you expect. Set a heap limit in the runtime config file with `System.GC.HeapHardLimitPercent`. The matching environment variable is read as hexadecimal, so prefer the file.

That is why the register starts this stack at Dedicated M. A runtime needs headroom as well as a heap. Start there. Move only when the metrics tell you to. See [Scaling](https://customhosted.com/scaling) for the signals. See [Patching](https://customhosted.com/patching) for what happens when a runtime reaches end of life.

№ 07 A starting configuration

## A starting configuration

A typical Java or .NET service: Dedicated M, a standard managed database, and the iteration add-on.

- **Base plan**: Dedicated M
- **Iteration — CodeHerder loop**: +$25/mo
- **Managed database**: DB Standard — +$25/mo
- **Estimated total**: $109/mo

[Get this quoted →](https://customhosted.com/contact?plan=DD-M&amp;addons=AD-CH&amp;db=DB-STANDARD&amp;src=dotnet-java) [Size it differently on the estimator →](https://customhosted.com/#estimate)

№ 08 FAQ

## .NET & Java questions

The questions this stack raises on its own. General hosting questions live on the homepage.

1. 01 Do you run .NET Framework apps? A .NET Framework app (version 4 and older) runs only on Windows. That is a custom quote. Current .NET runs on the standard plans. CustomLabs can port a Framework app to current .NET, and CodeHerder then ships the follow-up changes.
2. 02 Can we ship the app in a container? Yes. A Java or .NET image runs on a dedicated instance like any other image. The Docker page explains how.
3. 03 Do Kotlin and Scala run the same way? Yes. They compile to the same bytecode as Java and run on the same JVM. The memory advice on this page applies to them too.
4. 04 Can the instance build the app? It can, but it should not. A Maven or Gradle build often needs more memory than the app does. Compile in the pipeline and copy the finished package to the instance.
5. 05 Do we need Dedicated M, or will S do? A small service can fit in S. A minimal API or a natively compiled Quarkus app often does. Measure first, then move. The Scaling page lists the signals.

№ 09 See also

## Keep exploring

- [Scaling The signals that show an instance is too small, and what a move up involves.](https://customhosted.com/scaling)
- [Patching How we patch the instance, and what happens when a runtime reaches end of life.](https://customhosted.com/patching)
- [Docker Ship the app in an image instead. One container runs on a dedicated instance.](https://customhosted.com/host/docker)
- [Deploys What happens between a merge and a live change, and what a restart takes down.](https://customhosted.com/deploys)

## Ready to start?

Tell us what you're running — one fixed monthly rate, within a business day.

[Get a quote →](https://customhosted.com/contact)
