A daily diary of Java

Source: Internet
Author: User

1. Two most basic Java recovery algorithms: copy algorithm and tag cleanup algorithm                 Copy algorithm: two regions A and b, the initial object in a, the object that continues to survive is transferred to B. This is the most commonly used algorithm for the new generation                  Tag Cleanup: an area that marks the object to be recycled, and then recycles it, which is bound to appear fragmented, then leads                   labeling-sorting algorithms: More defragmentation, more memory, larger objects two concepts: the new generation and the old generation                  Cenozoic: initial object, short life cycle                  Permanent Generation: long-existing objects The entire Java garbage collection is a collaboration between the new generation and older generations, which is called generational recycling. The p.s:serial new collector is for the generation of collectors, using the copy algorithm          parallel New (parallel) collector, The new generation uses the replication algorithm, the old age uses the marker sorting          parallel  scavenge (parallel) collector, for the new generation, uses the Copy collection algorithm         Serial old (serial) collector, replication in the new generation, tag cleanup in older years           Parallel &nbSp; old (parallel) collector, Tag grooming         CMS collector for older years, based on tag cleanup         G1 Collector: The overall is based on tag cleanup, locally using replication  2. objects are stored in heap memory, and reference variables are stored in stack memory. The stack memory points to the heap Memory.  3. object-oriented Five basic Principles single duty principle (single-resposibility Principle): a class, It is best to do only one thing, only a change that causes it. The principle of single responsibility can be regarded as the extension of low coupling, cohesion in object-oriented principle, defining responsibility as the cause of change, in order to improve cohesion to reduce the cause of change.  
Open closure principle (open-closed principle): software entities should be extensible and non-modifiable. That is, open to the extension, to modify the Closed.
Liskov substitution principle (liskov-substituion Principle): subclasses must be able to replace their base classes. This idea is embodied in the constraints of inheritance mechanism, only the subclass can replace the base class, it can ensure that the system in the runtime to identify the subclass, which is the basis of ensuring inheritance Reuse.
Dependency inversion principle (dependecy-inversion Principle): dependent on Abstraction. In particular, high-level modules do not rely on the underlying modules, both of which are dependent on abstraction;
Interface Isolation principle (interface-segregation Principle): use multiple small, dedicated interfaces instead of a large total interface.

A daily diary of Java

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.