Learn about garbage collection in java interview questions, we have the largest and most updated garbage collection in java interview questions information on alibabacloud.com
. For example, a temporary object in a method becomes a useless object when the method call is complete, and its memory can be freed at this time. (2)Javaprovides some classes for garbage collection and provides a way to enforce garbage collection--calledSystem.GC (), but this is also an uncertain approach. Javadoes no
object objects cannot be freed because they will also be used by vectors. Static Vector v = new Vector (); for (int i = 1; i =
new
Object (); V.add (o); o = null ;} In this example, there is a reference to the vector object in the code stack with reference to the V and object o. In the For loop, we constantly generate new objects, add them to the Vector object, and then empty the O reference. The question is, if a GC occurs when the O reference is empty, can we cre
One, Java Virtual machine logical recovery mechanism1. Java Garbage collectorThe Java garbage collector is one of the three important modules of the Java Virtual Machine (JVM) (the other two are the interpreter and multithreading
because the generation of Java to GC garbage collection, no generational mechanism as long as you can determine which objects need to be recycled, the JVM can be recycled, then why should be generational. There's a reason for it. Obviously, for efficiency, generational can make GC more efficient.
You can try to think that if all the objects are in memory without
1. Core Idea of the garbage collection AlgorithmThe Java language sets up a garbage collection mechanism to track the objects in use and discover and recycle objects that are no longer used (referenced. This mechanism can effectively prevent two risks that may occur in dynam
How does the Java garbage collection (GC) principle benefit us? For software engineers, satisfying technical curiosity is one, but it's important to understand that GC can help us write Java applications better.The above is my personal subjective view, but I believe that mastering GC is an essential skill to be a good
compiled, but this step does not generate the machine code for a particular platform, but rather generates a platform-independent byte code. Of course, this bytecode is not executable and must be interpreted using the Java interpreter. Therefore , the Java language can be considered as both a compiled language and an interpreted language. the Java program must b
memory management.Java garbage collection mechanismThe Java garbage collector is responsible for completing 3 tasks: allocating memory, ensuring that the referenced object's memory is not being reclaimed incorrectly, and reclaiming the memory space of objects that are no longer referenced.
Vamei Source: Http://www.cnblogs.com/vamei Welcome reprint, Please also keep this statement. Thank you!There has been some knowledge of memory management and garbage collection in the entire tutorial. Here's a little summary.Java is run in a virtual memory environment of the JVM. Memory is divided into stacks (stack) and heaps (heap). We will examine these two areas separately.StackThe basic concept of the
management.Java garbage collection mechanism
Java garbage collector is responsible for completing three tasks: allocating memory, ensuring that the memory of referenced objects is not recycled incorrectly, and reclaim the memory space of objects that are no longer referenced. Garb
What are the benefits of understanding the garbage collection mechanism (GC) for Java developers? The first thing you can do is to satisfy your curiosity as a software engineer, and second, to learn more about how GC works can help you write better Java applications.This represents only my personal opinion, but I belie
The Java garbage collection essence is divided into 4 parts, this is the 1th part of this article. The tradeoff points, object lifecycles, and global pause events are described in part 1th.Serial, parallel, concurrent, CMS, G1, Young Gen, Cenozoic (New gen), Legacy generation (Old Gen), Perm Gen, Eden (Eden), old age (tenured), surviving area (Survivor Spaces), S
Garbage collection of Java virtual machinesJava Technology and JVM (Java Virtual machine)First, Java Technology Overview:Java is a programming language and a computing platform that was first released by Sun in 1995. It is the technical foundation of
1. The significance of garbage collection
In C + +, the memory of an object is occupied until the program is finished running, and cannot be allocated to other objects until it is explicitly released, whereas in Java the memory becomes garbage when no object reference points to the memory originally allocated to an ob
In the past, little attention to memory problems, basically no attention, this aspect of the small white, because they are writing self-entertainment small program, not pay attention to performance, not to provide services. Enterprise-level applications are significantly more demanding in terms of program robustness, so consider more questions. For large companies, in order to deal with a variety of situations, server resources are certainly sufficien
From: http://www.cnblogs.com/cesc711/archive/2009/05/11/1454337.html
Java garbage collection mechanism
By cesc711, 456 visits, network Abstract, favorites, Edit
1. Who is doing garbage collection?A popular saying is that in C ++, the system is doing
This article Importnew-Wang Xiaojie without permission, prohibit reprint!This article is the third in a series of articles for the Java GC expert. In the first article, "Becoming a JAVAGC expert Part I-Java garbage collection mechanism" we learned about the execution of different GC algorithms, how the GC works, what i
Why to divideThe generational garbage collection strategy is based on the fact that the life cycle of different objects is not the same . Therefore, different life cycle objects can be collected in different ways to improve the efficiency of recycling.In the course of running a Java program, a large number of objects are generated, some of which are related to bu
OverviewA very important difference between Java and C + + is the management of memory, the automatic memory management of Java and the garbage collection technology, which simplifies the programming process by eliminating the need for Java programmers to release the memory
OverviewOne important difference between Java and C + + is the management of memory. Java's own active memory management and garbage collection technology make Java program apes do not need to release the memory of discarded objects. This simplifies the programming process. At the same time, the problem of memory leaks
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.