First, the JVM memory structureThe Java Virtual opportunity divides the memory into several different management areas, each of which has its own purpose, depending on the characteristics of different tasks and the use of different algorithms in garbage collection. The whole is divided into the following sections:Program Counter Register, JVM virtual machine stack (JVM Stacks), local method Stack (Native methods Stacks), Heap (heap), method areaSuch a
I recently read GC (Garbage Collector) related things and found several good articles. Although I was older (06 years old), it is worth reading, the GC (Garbage Collector) Here is mainly about flashplayer9. Even if the English language is poor, a very small number of statements are not translated, because I don't know how much it takes for everyone to wait. Welcome to the layout. ^_^ most of this article is
When it comes to garbage collection (garbage collection,gc), many people naturally connect it to Java. In Java, programmers don't have to worry about memory dynamic allocations and garbage collection issues, all of which are given to the JVM to handle. Garbage collection, as the name implies, frees up space for
This article focuses on garbage collectionAlgorithm. The garbage collection mechanism first appeared in the world's second-largest language, lisp, Jean E. sammet once said that one of the longest sharing of The LISP Language is a non-verbal feature, which represents the terminologies of the system's automatic memory processing approach-garbage collection (GC,
(a) The basic assumptions of the garbage collector
(1) objects that have recently been allocated memory space are most likely to need to be freed. Before a method is executed, it is often necessary to allocate memory space for the object to which the method is used, and searching for the most recently allocated collection of objects helps to free up the amount of free memory space that is likely to be spent.
(2) The longest-life object is least likel
Speaking of garbage collection (garbage collection,gc), most people regard this technique as the companion product of the Java language. In fact, the history of GC is far longer than that of Java, and the 1960 birth of Lisp in MIT was the first language to actually use memory dynamic allocation and garbage collection techniques. When the list is still embryonic,
Java garbage collection mechanism JDK 5 provides four different garbage collection mechanisms: Serial collection, generational collection, parallel collection, and concurrent mark-clear collection. Java garbage collector is responsible for completing three tasks: allocating memory, ensuring that the memory of referenced objects is not recycled incorrectly, and re
Once a class is defined, we can new any number of objects. At this point, the memory allocation on the managed heap and stack is generated, and the heap will open up a new space to store the class object, and the stack simply stores the reference. In general, garbage collection and memory management are only relative to the managed heap. The memory management of C # is very convenient-that is, the garbage c
Introducing Garbage Collection
What memory needs to be recycled?
Reference counting method
Analysis of accessibility
How to Recycle
Marking Mark
Normal deletion Clear
Deletion with compacting compression
Why do I need generational collection?
Generational generation of the JVM
Cenozoic
Old age
Permanent generation
Details of the generational garbage
Description:
In this paper, Garbage Collection is translated as "garbage collection", garbage collector translated as "garbage collector";
It is generally recognized that garbage collection and garbage collecting are synonyms.
M
(1) In addition to releasing objects that are no longer referenced, the garbage collector also handles heap fragments . The request to allocate a new object may have to increase the size of the heap space, although the free space available is sufficient, but there is no contiguous space in the heap to place new objects. May cause unnecessary "out of memory" errors for the virtual machine.(2) with the garbage
Object referenceGarbage collection in Java is typically done in the Java heap because almost all of the object instances in Java are stored in the heap. When it comes to garbage collection in the Java heap, it's natural to talk about references. Before JDK1.2, the reference definition in Java was very pure: if the value stored in the data of the reference type represents the starting address of another piece of memory, it is said that this memory repr
If the collection algorithm is the method of memory recycling, then the garbage collector is the specific implementation of memory recycling. There is no provision for how the garbage collector should be implemented in the Java Virtual Machine specification, so the garbage collectors provided by different vendors and versions of virtual machines can vary greatly,
Basic recycling Algorithm
1. reference counting)The old recycling algorithm. The principle is that this object has a reference, that is, adding a count. deleting a reference reduces the count. During garbage collection, only objects with zero collection count are used. The most critical issue of this algorithm is that it cannot handle circular references.2. Mark-clear (mark-sweep)This algorithm is executed in two phases. In the first stage, all refere
Garbage collection in. netBy Amit KukrejaHttp://www.codeproject.com/dotnet/garbagecollection.asp#xx821174xxGarbage collection in. netThis article describes how garbage collection is executed in. net!This is critical, although many people think it is too theoretical, just like the textbook on compilation principles in Universities (koffer note)
Content directory:
IntroductionAbout
For a long time, garbage collection has a poor reputation in the software industry. Many Program Personnel think that garbage collection is not as direct and efficient as they are. This is sometimes true. A memory reclaim method that is well designed and customized for a specific program is certainly better than providing garbage collection performance for all pr
In this section, let's summarize what the JVM garbage collector does. Garbage collectorDetermine if an object reference is invalidObject Survival Judgment algorithmReference judgment ProcessIntroduction to garbage collection algorithmsGarbage collectorNew Generation garbage collectorOld age
In-depth understanding of Java garbage collection mechanismOne: The significance of garbage collection mechanismOne notable feature of the Java language is the introduction of the Java recycling mechanism, which is the most troublesome memory management problem for C + + programmers, which allows Java programmers to write programs without thinking about memory management. Because there is a
In-depth understanding of Java garbage collection mechanismOne: The significance of garbage collection mechanismOne notable feature of the Java language is the introduction of the Java recycling mechanism, which is the most troublesome memory management problem for C + + programmers, which allows Java programmers to write programs without thinking about memory management. Because there is a
Java garbage collection mechanism
The blog named Java garbage collection mechanism, giving people feel like garbage collection is unique to the Java language. In fact, garbage collection (garbage Collection) is far more remote than Java. There are 3 things to consider
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.