data in memory to improve performance, such as exceeding the default maximum value of 128MB, it needs to increase the maximum memory available to the Java Virtual machine, otherwise an out-of-memory (out-of-system) exception will occur. When you start Java, you need to use the following two parameters:-xms the size of memory used when initializing a Java virtual
/home/tomcat/tomcat8_1/bin/catalina.sh +97
Insert the following code
Java_opts= "-DJAVA.AWT.HEADLESS=TRUE?-DFILE.ENCODING=UTF-8?-SERVER?-XMS800M?-XMX800M?-XX:NEWSIZE=400M?-XX: maxnewsize=400m?-xx:permsize=400m?-xx:maxpermsize=400m "
Server: Be sure to act as the first parameter in multiple CPU good performance when
-xms : initial heap Memory Heap size, minimum memory used , the CPU This value should be larger when performance is high
-
Java Virtual Machine-Java memory area, java-java
A Brief Introduction to the memory area of Java:
Data Area During Running
HotSpot Virtual Machine objects
I. Overview
2. Data area 2.1 program counters during running
Program Counter Register represents the row number indic
immediately compiled code cache), Code for each class structure, such as running a constant pool, fields, and method data, and methods and construction methods.When the JVM starts, it retains a fixed amount of memory to the heap memory, which is not necessarily used by the JVM, but it can be determined that this portion of the reserved memory is not used by other processes, which is -Xmx参数指定。 allocated to the JVM when the JVM is started in the other
implementation. Currently, mainstream virtual machines are implemented according to the Scalability (controlled by-Xmx and-Xms ). If the heap does not have memory for instance allocation and cannot be expanded, an OutOfMemoryError error will be thrown.Method Area
Like the java heap, It is the memory area shared by various threads. It is used to store data such as class information, always bright, static va
way, if it is yarn-client mode, The default read is java_opts in the Spark-class file, and if it is Yarn-cluster mode, the Read is the corresponding parameter value for the spark.driver.extraJavaOptions in the spark-default.conf file. (2) JVM Parameters for Executor:-XMX,-XMS, if it is yarn-client mode, the Spark_executor_memory value in the Spark-env file is read by default, the-XMX,-XMS value is the s
.
Iv. stack similarities and differences
The heap storage space can be used by any part of the application, while the stack storage space is only used by the corresponding execution thread
Once an object is created, it is allocated a storage space in the heap and a reference to it is kept in the stack space. Only the basic data types and reference variables that point to the objects in the heap are saved in the stack space
The objects stored in the heap can be accessed glob
Java heap, the GC heap is the largest memory area managed by the Java Virtual machine, and is a memory area shared by each thread that is created when the JVM is started. This memory area holds the object instances and arrays (all new objects). Its size is set by the-XMS (minimum) and-xmx (maximum) parameters,-xms the minimum memory requested when the JVM starts
line stacks, which is the default unit of bytes. Similar to-XMX, you can also use K or M to set a larger value. The default size of the operating system assigned to line stacks is typically 1MB.You can also set the size of the stack when you create a thread object in Java, and the constructor prototype is thread (Threadgroup group, Runnable Target, String name, Long stackSize).13.-xprofOutputs diagnostic i
directly to the address of 3 because there are already 3 literals in the stack. In this case, A and B both point to 3.5, heap, and non-heap (non-heap) memoryAccording to the official statement, "Java virtual machines have a heap, the heap is a runtime data region, and all class instances and arrays of memory are allocated from here." The heap is created when the Java Virtual machine is started. ”You can se
Java heap space is a very painful problem, if the development of debugging encountered fortunately, if the project is running after a period of time to throw the exception, it is really tragic (then you have to find out in the code where the memory leaks), this is really a sad story.1.java head space heap memory overflowAnalysisThis problem occurs because there are too many objects created by the
Java stack Memory heapJava divides memory into two kinds, one called stack memory, and the other is called Heap memory, which has different functions. Stack memory is used to store local variables and method calls.Stack memory belongs to a single thread, each thread will have a stack of memory, its stored variables can only be seen in its own thread, that is, stack memory can be understood as a thread of private memory.Objects in the heap memory are v
Java Memory Overflow DetailedOne, the common Java memory overflow has the following three kinds:1. Java.lang.OutOfMemoryError:Java heap Space----JVM heap (heap) overflowThe JVM will automatically set the JVM heap value when it is started, and its initial space (that is,-XMS) is 1/64 of the physical memory, and the maximum space (-XMX) cannot exceed the physical m
Java Memory Overflow detailedone, the common Java memory overflow has the following three kinds:1. Java.lang.OutOfMemoryError:Java heap Space----JVM heap (heap) overflowThe JVM will automatically set the JVM heap value when it is started, and its initial space (that is,-XMS) is 1/64 of the physical memory, and the maximum space (-XMX) cannot exceed the physical m
-XX:USEG1GCJVM parameter to open the use of the G1 garbage collector.
Optimization of Java 8
When using the G1 garbage collector, open the use-XX:+USESTRINGDEDUPLACATONJVM parameter. It optimizes heap memory usage by moving duplicate string values to the same char[] array. This is the option introduced by Java 8 U 20.
The above four Java garbage collector, when t
We usually use some of the software, a part of the need for Java environment support, but sun so many products, let people dazzling version number, before looking at the same abbreviation, let us choose the time often deterred, had to follow the feeling to go. So here's what I'm going to be trying to tell you about, first of all, let's look at the many Sun products::http://developers.sun.com/downloads/Haha has not expanded their sub-options, let peopl
method area, internal processing of the JVM, or optimization (such as Jitcompiler,just-in-time Compiler, the immediately compiled code cache), Code for each class structure, such as running a constant pool, fields, and method data, and methods and construction methods.The JVM memory contains the following sections:
Heap Memory: Storing Java objects
Non-heap (non-heap memory): Store class loading information and other Meta-data
Miscel
variable area is used to store the local variable and the parameter in the method, the operand stack is used to hold the intermediate result produced in the method execution process. The structure of the stack is as follows:3. JVM memory management and garbage collection mechanismThe JVM memory structure is divided into: Method area, stack memory (stack), heap memory (heap), local method stack (JNI call in Java), and the structure diagram is as follo
to store object instances and arrays. It is the largest part of memory managed by Java Virtual Machine and shared by all threads. It is created when the virtual machine is started and is also the necessary area for managing the garbage collector, almost all object instances are allocated memory here. If the Garbage Collector uses generational collection, it can also be divided into the new generation and the old generation, and there are more detaile
space they occupy will be reclaimed for allocation to new objects.
To understand the garbage collection mechanism and the various garbage collection algorithms, you first need to know some knowledge about the Java Platform memory model.
Garbage collection and Java Platform memory model
When you start a Java program with the command line and specify the startu
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.