Technical Anshu
Tutorials Blog
🧠 Memory Heap Fix

Jira Out of Memory Startup Failure Set Heap Size Safely Without Crashing the Server

Memory faults stop Jira in two opposite ways: too little heap and it dies slowly with OutOfMemoryError - too much requested and the Java machine cannot even be born. The settings live in one file.

✍️ Technical Anshu🪟 Windows Server⏱️ 8 minute read
🎥 Watch the full fix in the video — every step shown live on screen

Jira runs inside a Java virtual machine, and that machine reserves its working memory - the heap - up front, using two numbers: a minimum and a maximum, written in setenv.bat. When those numbers no longer fit your server or your Jira's size, startup fails. The trap is that both directions of wrong look similar from the browser: Jira is simply down. This page teaches you to tell them apart from the logs, and to change heap deliberately, within what your server's RAM can honestly give.

setenv.bat - the heap lines that decide whether Jira can start (illustration)
set JVM_MINIMUM_MEMORY=1024m set JVM_MAXIMUM_MEMORY=2048m Log signatures: java.lang.OutOfMemoryError: Java heap space (heap too small) Could not create the Java Virtual Machine (heap too big to reserve)
Two opposite faults, two opposite fixes - the log tells you which one you have. Example values shown as an illustration.
1

Tell the Two Memory Faults Apart First

Raising the heap when the real problem is 'heap too big to reserve' makes things worse, and lowering it when Jira is genuinely starving does the same. Spend two minutes identifying your fault before touching a single number.

  1. If Jira starts, runs for a while (minutes to days), then slows down and dies, search the logs for OutOfMemoryError - that is a heap that is too small for the workload
  2. If the service fails within seconds of starting, and the log or Event Viewer says Could not create the Java Virtual Machine or an error about reserving memory, the requested heap is too large for the free RAM
  3. If a brand-new or upgraded server shows the instant failure, also suspect a 32-bit Java - it cannot reserve a large heap no matter how much RAM the machine has
  4. Write down which signature you have; the fix is the opposite in each case
2

Change the Heap in setenv.bat

On Windows, Jira's heap lives in setenv.bat in the bin folder of the install directory, in two variables: JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY. Values look like 1024m or 2048m. If Jira runs as a service, the same values may also be recorded in the service configuration - Atlassian provides a configuration tool in the bin folder, and both places must agree.

  1. Stop the Jira service and make a copy of setenv.bat before editing - one line back is your undo
  2. Open setenv.bat and find the two memory lines; note the current values
  3. For a too-small heap: raise JVM_MAXIMUM_MEMORY in steps (for example from 1024m to 2048m), not in one giant leap
  4. For a too-large reservation: lower the maximum to a value the server can genuinely spare
  5. Start the service and confirm Jira completes startup; heap is read only at launch, so a restart is mandatory for every change
3

How Much Heap Is Honest for Your Server

The heap is a reservation from the same RAM that Windows, the database and everything else on the machine also need. Giving Jira every gigabyte guarantees the machine swaps to disk - which is slower than a small heap ever was. A practical rule: on a shared server, Jira's maximum heap should leave clear room for the operating system and the database; on a dedicated Jira server it can take the larger share, but never all of it.

  1. Check total RAM in Task Manager's Performance tab, and what is free while the database is running
  2. Keep Jira's maximum heap comfortably below the free amount - not equal to it
  3. If the database shares the machine, count its memory too; the two of them together must fit
  4. After changing, watch memory during the busiest hour, not just at startup - a heap that survives 9 a.m. logins is the real test
4

When More Heap Is Not the Answer

Honesty matters here: OutOfMemoryError on a Jira that ran fine for a year usually means growth - more users, more issues, heavier plugins - or a plugin leaking memory. Raising the heap buys time, and buying time is legitimate. But if the errors return within days at the new size, the cause is a leak or a workload the server cannot carry, and the real fixes are finding the offending plugin, or giving Jira a bigger server - not another blind increase.

  1. Note the date and heap size at each OutOfMemoryError - a shrinking interval between errors is the leak signature
  2. Review recently installed or updated plugins first; startup and memory problems love to follow them
  3. Check whether the error names heap space or another memory area - they are different problems with different fixes
🔴 Never set the maximum heap to the server's total RAM. The JVM also needs memory outside the heap, Windows needs memory to live, and the database needs its share. A Jira that grabs everything does not become fast - it pushes the whole machine into disk swapping, and then everything, including Jira, crawls. Change heap in modest steps, restart, observe, and keep your backup copy of the original setenv.bat.

🎥 See the Complete Fix in the Video

The full Jira startup repair, step by step, with the exact screens and log lines shown live.

▶️ Watch Full Video
❓ Common Questions (FAQ)

Where exactly do I change Jira memory on Windows

In setenv.bat, inside the bin folder of the Jira install directory - the JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY lines. If Jira runs as a Windows service, confirm the same values in the service configuration using the Jira configuration tool in the same bin folder. Restart the service afterwards; memory settings are only read at startup.

Jira says Could not create the Java Virtual Machine right after I increased memory. Why

Because the JVM reserves the maximum heap as one continuous block at startup, and it could not get it - either the free RAM is smaller than the number you set, or a 32-bit Java is installed, which caps out far below modern heap sizes. Lower the maximum to a value the machine can honestly spare, and confirm Jira is using a 64-bit JDK.

How do I know if Jira needs more memory or has a memory leak

Watch the interval. A growing Jira that runs out after weeks, then months at a larger heap, is simply growing. A Jira that starts failing again within days of each increase, at roughly the same point after each restart, is leaking - most often through a plugin. At that point, stop raising the heap and investigate plugins and recent changes instead.

This guide is based on the Technical Anshu video on fixing a Jira that will not start • Stuck on a step? Ask in the video comments — you will get a reply 🙏