implement memory compression (more compact ).
After compression, the variables and CPU registers that point to the pointers of these objects will now become invalid. The Garbage Collector must re-access all the roots and modify them to point to the new memory location of the object. This causes significant performance loss. This loss is also the main drawback of the hosting heap.
Based on the above features, the garbage collection algorithm caused by garbage collection is also a research topic.
memory for the JVM to 3550M. -xms3550m : Set the JVM to drive memory to 3550m. This value can be set to the same as-xmx to avoid the JVM reallocating memory after each garbage collection completes. -xmn2g : Sets the young generation size to 2G. entire Heap size = younger generation size + older generation size + persistent generation size . The permanent average fixed size is 64m, so increasing the younger generation will reduce the size of older generat
"object recovery" topics that are not discussed).Here are some garbage collection topics to tell.The "generation" of the objectWhen the CLR is garbage collected, the garbage collector goes back to the managed heap to check if objects can be recycled, which is a very resource-intensive process. To prevent every garbage collection from facilitating all objects on the managed heap, the CLR divides the objects above the managed heap into "generations", f
limits for the system. Under the 32-bit system, the 1.5g~2g;64 is generally limited to memory unrestricted for the operating system. I test under Windows Server 2003 System, 3.5G physical memory, JDK5.0, Max can be set to 1478m.Typical settings:
java -xmx3550m-xms3550m-xmn2g -xss128k - xmx3550m : Sets the maximum available memory for the JVM to 3550M. -xms3550m : Set the JVM to drive memory to 3550m. This value can be set to the same as-xmx to avoid the JVM reallocating memory af
the associated operating system (32-BT or 64-bit) limits ; The available virtual memory limits of the system; the available physical memory limits for the system. Under the 32-bit system, the 1.5g~2g;64 is generally limited to memory unrestricted for the operating system. I test under Windows Server 2003 System, 3.5G physical memory, JDK5.0, Max can be set to 1478m. Typical setup: java-xmx3550m-xms3550m-xmn2g-xss128k-xmx3550m: Sets the JVM's maximum available memory to 3550M. -xms3550m: Set the
compression (more compact ).
After compression, the variables and CPU registers that point to the pointers of these objects will now become invalid. The Garbage Collector must re-access all the roots and modify them to point to the new memory location of the object. This causes significant performance loss. This loss is also the main drawback of the hosting heap.
Based on the above features, the garbage collection algorithm caused by garbage collection is also a research topic. Because it would
English Original: Maoni Stephens, compilation: Zhao Yukai (@ Jade Kai Sir)
The CLR garbage collector divides objects by the amount of space they occupy. Large objects and small objects are handled in a very different way. For example, memory defragmentation-the cost of moving large objects in memory is expensive, so let's look at how the garbage collector handles large objects, and how large objects have a potential impact on program performance.
Large object heap and garbage collection
In. Net
Heap Size settings
The maximum heap size in the JVM has three limitations: the data Model (32-BT or 64-bit) of the associated operating system, the system's available virtual memory limits, and the available physical memory limits for the system. Under the 32-bit system, the 1.5g~2g;64 is generally limited to memory unrestricted for the operating system. I test under Windows Server 2003 System, 3.5G physical memory, JDK5.0, Max can be set to 1478m.
Typical settings:
JAVANBSP;
default value -XMS Initial heap size physical memory 1/64 ( default (minheapfreeratio parameter can be adjusted) when the free heap memory is less than 40%, The JVM will increase the heap until the maximum limit of-xmx. -xmx Maximum heap size physical Memory ( default (maxheapfreeratio parameter can be adjusted) when the free heap memory is greater than 70%, the JVM will reduce the heap until the minimum limit of-XMS -xmn Young generation size (1.4or lator) Note: The size here is (ede
;-Webkit-border-bottom-left-radius: 10px;-Moz-border-radius-topleft: 4px;-Moz-border-radius-topright: 3px;-Moz-border-radius-bottomright: 6px;-Moz-border-radius-bottomleft: 10px;}7. General media Query
This is a very good template for various fragmented media queries and can also be used on mobile devices. This code can even be referenced to the retina device by using min-device-pixel-ratio.
/* Smartphones (portrait and landscape )-----------*/@ Media only screenAnd (min-device-width: 320px) and
cannot be recycled.Once such an object is found in the markup process, it is moved from the unreachable list to the root list, and when the tag is complete, the unreachable list remainsAll objects are literally garbage objects, and the next garbage collection is only limited to the unreachable list.Generational recyclingThe idea of generational recycling: dividing all memory blocks in a system into different collections based on their survival time, each of which is called a "generation"The fre
unwanted), can be fixed size or extensible when implemented, and the current mainstream virtual machines are extensible. If you do not have enough memory allocations or extensions after the garbage collection has been performed, you will throw a Outofmemoryerror:java heap space exception.
There is much more to the heap area, which is described in detail in the next section, "Java Memory allocation mechanism."
5, methods area: In the Java Virtual Machine specification, the method area is treated
continuous (not physically required), when implemented, can be fixed-size, or extensible, the current mainstream of virtual machines are extensible. If there is still not enough memory allocation and no expansion after the garbage collection is performed, the OutOfMemoryError:Java Heap Space exception will be thrown.There is much more to the heap area, which is described in detail in the next section, "Java memory allocation mechanism ".5, Method area: In the Java Virtual Machine specification,
Garbage collection-generationThe proxy is a mechanism adopted by the CLR garbage collector. its only purpose is to improve the application.ProgramPerformance, the use of the garbage collector to do the following:1: The newer the object, the shorter the lifecycleIt is similar to the stack principle. The local variables defined first after the first time are used to stay in the stack for a relatively long time.2: The older the object, the longer the lifecycle, Which will be explained later.3: recl
selection details refer to the JVM tuning documentation.Slightly explained, the parallel algorithm is a multi-threaded garbage collection, the recovery period will suspend the execution of the program, while the concurrency algorithm, but also multi-threaded recycling, but does not stop the application execution. therefore, the concurrency algorithm is suitable for some programs with high interactivity. After observation, concurrency algorithms reduce the size of younger
Heap Size SettingsThe maximum heap size in the JVM has three limitations: the data Model (32-BT or 64-bit) of the associated operating system, the system's available virtual memory limits, and the available physical memory limits for the system. Under the 32-bit system, the 1.5g~2g;64 is generally limited to memory unrestricted for the operating system. I test under Windows Server 2003 System, 3.5G physical memory, JDK5.0, Max can be set to 1478m.Typical settings:
JAVANBSP; -xmx3550m-x
parallel algorithm is selected for the younger generation, and the selection details refer to the JVM tuning documentation.Slightly explained, the parallel algorithm is a multi-threaded garbage collection, the recovery period will suspend the execution of the program, while the concurrency algorithm, but also multi-threaded recycling, but does not stop the application execution. Therefore, the concurrency algorithm is suitable for some programs with high interactivity. After observation, concur
continuous (not physically required), when implemented, can be fixed-size, or extensible, the current mainstream of virtual machines are extensible. If there is still not enough memory allocation and no expansion after the garbage collection is performed, the Outofmemoryerror:java heap space exception will be thrown.There is much more to the heap area, which is described in detail in the next section, "Java memory allocation mechanism ".5, Method area: In the Java Virtual Machine specification,
completes. -xmn2g : Sets the young generation size to 2G. entire JVM Memory size = younger generation size + older generation size + persistent generation size . The permanent average fixed size is 64m, so increasing the younger generation will reduce the size of older generations. This value has a large impact on system performance, and Sun's official recommendation is 3/8 for the entire heap. -xss128k : Sets the stack size for each thread. After
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.