Memory distribution in JavaIn the JVM, memory is organized in terms of generational.Among them, heap memory is divided into young generation and old generation, non-heap memory is mainly permanent area, mainly used for storing some kinds of metadata, constant pool and other information. And the younger generation is divided into two kinds, one is Eden area, the other is two size equivalent survivor area. The reason that Java memory is organized on a generational basis is based on a "weak hypothe
old age (usually old age recovery is relatively slow). In practice, the initial and maximum values of the heap are usually set equal, which can reduce the number of garbage collections and spatial expansion that the program runs, thereby improving program performance. 2.-XMS512M: Sets the initial value memory size of the heap of the Java virtual machine, in megabytes (m), This value can be set to the same as-xmx to avoid the JVM reallocating memory after each garbage collection completes .3,-xm
the heap until the maximum limit of-xmx.
-xmx
Maximum heap size, default to physical memory (
When the default free heap memory is greater than 70%, the JVM will reduce the heap until the minimum limit of-XMS
-xmn
Young generation size (1.4 or Lator)
Note: The size here is (eden+ 2 survivor space). It is different from the new Gen shown in Jmap-heap.The entire heap size = younger generation size + old generation size + persistent generation size.I
method stack.Java method Areas are called permanent generations in the Sun hotspot virtual machine, many people think that the part of the memory is not recycled, the Java Virtual Machine specification does not have a garbage collection of this part of the memory provisions, but the method area of obsolete constants and useless classes still need to be recycled to ensure that the permanent generation will not occur memory overflow.Method of judging o
.
Full GC: Collects the entire heap, including the pattern of all parts of young Gen, Old Gen, Perm Gen (if present). A young GC is performed by default before full GC, and can be configured with parameter-XX:+SCAVENGEBEFOREFULLGC
Various GC algorithms and how to use them
Young
collector Old
collector
JVM Option
Serial (defnew)
Serial Mark-sweep-compact
-xx:+useserialgc
Parallel Scavenge (Psyo
the "weak-generation hypothesis"--weakgenerational hypothesis. So in order to present this hypothesis, the HotSpot VM is physically divided into two areas-the "young generation" and the "Old Generation" (Younggeneration and Generation).Young generation: Most new objects will be stored here first. When a large number of objects quickly become unreachable, some objects created in the younger generation disappear (recycled). When the objects in the young generation disappear, the "minor GC" execut
of the app, the smaller the total amount of time spent on garbage collection, the better. For applications that interact with the user, you may want to have a smaller time interval for the application that the garbage collection brings. In this case, a variety of garbage collection methods and corresponding performance tuning parameters are available in the JVM, and the application can be customized as needed.The most basic approach to the Java garbage collection mechanism is generational recyc
requested by the JVM, which defaults to 1/4 of physical memory but less than 1G By default, when the free heap memory is less than 40%, the JVM increases the size specified by heap to-XMX, which can be specified by-xx:minheapfreeration=, and when the free heap memory is greater than 70%, the JVM reduces the size of the heap to the size specified by the-XMS. You can specify this column by xx:maxheapfreeration=, and for running the system, to avoid frequent resizing of heap at run time, the-XMS i
interactive program may require a smaller application's pause time, but the time-to-go execution is more important for a non-interactive program. A real-time application may need to have a high value in both areas of garbage collection pause application time and the time ratio spent on garbage collection. Applications on personal computers or embedded systems are most concerned with a smaller resource metering (that is, the use of virtual machine resources).Generation of garbage collectionIn vi
:
Import Gcprint (Gc.get_threshold ())
Return (700, 10, 10), followed by two 10 is the threshold associated with generational collection, which can be seen later. 700 is the threshold at which garbage collection starts. Can be reset by the Set_threshold () method in the GC.We can also start the garbage collection manually, that is, using Gc.collect ().Generational recyclingPython also uses the strategy of generational (generation) recycling. The basic assumption of this strategy is that the long
list. Naturally, each collected object needs to provide some more information, the following code is the object of the collection must appear.
1 is stored before the object structure. */2 typedef Union _GC_HEAD {3 struct {4 Union _gc_head *GC_ Next; 5 Union _gc_head *Gc_prev; 6 py_ssize_t gc_refs; 7 } GC; 8 a long double dummy; /* Force worst-case Alignment */9 } pygc_head;
The actual structure of an object:
Each recycled object is co
objects, many objects quickly produce and disappear, but there are also some objects that are used for a long time. For the sake of trust and efficiency, we believe in the usefulness of these "longevity" objects, so we reduce the frequency of scanning them in garbage collection.The little guy needs more tests.Python divides all the objects into 0,1,2 three generations. All new objects are 0-generation objects. When a generation of objects has gone th
Young Generation Size Selection
Response Time-First application : as large as possible until the minimum response time limit of the system is approached (depending on the actual situation). In such cases, the frequency at which the young generation collects occurs is also minimal. At the same time, reduce the reach of older generations of objects.
throughput-First application : as large as possible, may reach Gbit degree. Because
application : as large as possible until the minimum response time limit of the system is approached (depending on the actual situation). In such cases, the frequency at which the young generation collects occurs is also minimal. At the same time, reduce the reach of older generations of objects.
throughput-First application : as large as possible, may reach Gbit degree. Because there is no requirement for response time, garbage collection can
obtaining high precision requires a very large sequencing depth.Chia-pet is marked by a specific protein factor and its associated chromatin interaction. The technique combines a paired end-label sequencing technique with chip to cross-connect a DNA fragment enriched with a protein that can be used to determine the long-range interaction of chromatin by a specific transcription factor of the entire genome, thus presenting high specificity and high resolution chromatin interactions.What is hi-c
adjusted.After the class loader reads the class file, it is necessary to put the class, method, and constant variables into the heap memory to facilitate execution by the executor. In general, the memory allocation of objects is done on the heap.In the course of running a Java program, a large number of objects are generated, some of which are related to business information, such as session objects, threads, and socket connections in HTTP requests, which are directly linked to the business and
reaches the threshold, the 0 generation gc,0 GC is triggered to enter GEN1 after the surviving objects in Gen 0. If Gen 1 's memory reaches the threshold, the 1 generation gc,1 GC recycles the Gen 0 heap and Gen 1 heap, and the surviving objects enter Gen2. 2 Generation GC recycles the Gen 0 heap, Gen 1 heap, and Gen 2 heapGen 0 and Gen 1 are relatively small, these two generations are always kept at around 16M; the size of the Gen2 is determined by
and long-lived objects, the mark-compact collector was formed. though it is a bit more complex than copying collectors, the fundamental idea is the same. there is a definite separation between the active section of the memory and the free/unused section. however, unlike the copying collector, the mark-compact collector scans for all reachable objects and compacts them at the bottom of the heap, leaving the remaining memory free for consumption. the catch is that it doesn' t have to fully compac
StatisticsC:\Users\Administrator>jstat -gc 2060 S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT20480.0 20480.0 0.0 13115.3 163840.0 113334.2 614400.0 436045.7 63872.0 61266.5 0.0 0.0 149 3.440 8 0.295 3.735
1
2
3
1
2
3
S0C: The size of the first surviving area
S1C: The size of the second surviving area
S0U: The use
size
CCSC: Compression class space size
CCSU: Compression class space usage size
YGC: number of young generations of garbage collection
YGCT: waste collection time for young generation
FGC: garbage collection times in the old age
FGCT: time spent on garbage collection in the old age
GCT: total time spent on garbage collection
Heap Memory Statistics
ngcmn: Cenozoic Minimum capacity
NGCMX: maximum capacity of the Cenozoic
NGC: Cu
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.