JVM--byte code loading

Source: Internet
Author: User

ClassLoader class Loader

Common class loaders have bootstrapclassloader<-extclassloader<-appclassloader<-users ClassLoader

Bootstrapclassloader: Loading Java's own core class;

Extclassloader loads the jar package in the/jre/lib/ext directory, and the same user can place the jar in that directory.

Appclassloader load Classpath the contents below,

Loading process:

Reads the file and loads, first requests the parent class loader to carry on the load, if the parent class loader cannot load, then the subclass to load, finally cannot find the class, then will throw the classnotfoundexception;

Step two, link. The byte code that has been loaded is parsed and verified to see if it conforms to certain specifications, otherwise it throws classnotfounderror. Then implement the allocation of memory.

Step three, initialize. Calls the constructor, initializes the static variable, and the passive block.

It is important to note that during class loading, multiple threads are blocked.

In fact, ClassLoader itself is a Java class, and these classes are implemented by the JVM kernel to implement loading.

JVM--byte code loading

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.