-
Notifications
You must be signed in to change notification settings - Fork 53
Java Memory Usage
The Java heap is the area of memory used to store objects instantiated by the applications running on the Java Virtual Machine (JVM). The Maximum Java Heap Size (Xmx) is the maximum amount of memory that a Java application can use. Objects in the heap can be shared between threads. Each thread in a Java application has its own stack (Xss). The stack is also used to hold return addresses, function/method call arguments, etc. JVM also keeps track of metadata of the classes (MaxMetaspaceSize) which have been loaded separated from the main Java heap.
The default values for Xmx
is based on the physical memory of the machine. From Java 11 the Xmx
value is 25% of the available memory with a maximum of 25 GB. However, where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB.
The default value for Xss
is 320 KB for 31-bit or 32-bit JVMs and 1024 KB for 64-bit JVMs.
The MaxMetaspaceSize
is unlimited by default.
Use these java command-line parameters to control the memory usage:
- Use
-Xmx
to specify the maximum Java heap size - Use
-Xms
to specify the initial/minimum Java heap size - Use
-Xss
to set the Java thread stack size - Use
-XX:MaxMetaspaceSize
to set the maximum size of the Metaspace.
Example to specify the amount of memory the JVM should use when starting a core system:
java -jar arrowhead-{core-system}-{version}.jar -Xms128M -Xmx1G
JVM will startup with 128 megabytes of memory and will allow the process to use up to 1 gigabyte of memory
Note: The higher traffic is expected, the more memory will be necessary. A lower Xmx value will cause a decrease in performance due to JVM has to force frequent garbage collections in order to free up space, also if the Xmx value is lower than the amount of live data, it might trigger OutOfMemoryError.
Certificates
Quick start
How to contribute?
- Inter-Cloud setup
- Java Memory Usage
- MySQL Connections
- Change Database Engine
- Compile Only One Module
Service Registry
- Service Registry - Overview
- Service Registry - Services
- Service Registry - Management
- Service Registry - Configuration
Orchestrator
- Orchestrator - Overview
- Orchestrator - Services
- Orchestrator - Management
- Orchestrator - Configuration
Authorization
- Authorization - Overview
- Authorization - Services
- Authorization - Management
- Authorization - Configuration
Gatekeeper
Gateway
Event Handler
- Event Handler - Overview
- Event Handler - Services
- Event Handler - Management
- Event Handler - Configuration
Choreographer
- Choreographer - Overview
- Choreographer - Services
- Choreographer - Management
- Choreographer - Configuration
Quality of Service Monitor
Certificate Authority
- Certificate Authority - Overview
- Certificate Authority - Services
- Certificate Authority - Management
- Certificate Authority - Configuration
System Registry
- System Registry - Overview
- System Registry - Services
- System Registry - Management
- System Registry - Configuration
Device Registry
- Device Registry - Overview
- Device Registry - Services
- Device Registry - Management
- Device Registry - Configuration
Onboarding
Data Manager
Time Manager
Plant Description Engine
- Plant Description Engine - Overview
- Plant Description Engine - Services
- Plant Description Engine - Management
- Plant Description Engine - Configuration
HawkBit Configuration Manager
Device Hub