Оку java virtual machine

Java Virtual Machine Technology

The JDK provides one or more implementations of the Java virtual machine (VM):

  • On platforms typically used for client applications, the JDK comes with a VM implementation called the Java HotSpot Client VM (client VM). The client VM is tuned for reducing start-up time and memory footprint. It can be invoked by using the -client command-line option when launching an application.
  • On all platforms, the JDK comes with an implementation of the Java virtual machine called the Java HotSpot Server VM (server VM). The server VM is designed for maximum program execution speed. It can be invoked by using the -server command-line option when launching an application.

Some features of Java HotSpot technology, common to both VM implementations, are the following.

  • Adaptive compiler — Applications are launched using a standard interpreter, but the code is then analyzed as it runs to detect performance bottlenecks, or «hot spots». The Java HotSpot VMs compile those performance-critical portions of the code for a boost in performance, while avoiding unnecessary compilation of seldom-used code (most of the program). The Java HotSpot VMs also use the adaptive compiler to decide, on the fly, how best to optimize compiled code with techniques such as in-lining. The runtime analysis performed by the compiler allows it to eliminate guesswork in determining which optimizations will yield the largest performance benefit.
  • Rapid memory allocation and garbage collection — Java HotSpot technology provides for rapid memory allocation for objects, and it offers a choice of fast, efficient, state-of-the-art garbage collectors.
  • Thread synchronization — The Java programming language allows for use of multiple, concurrent paths of program execution (called «threads»). Java HotSpot technology provides a thread-handling capability that is designed to scale readily for use in large, shared-memory multiprocessor servers.

Tools

  • Some operating characteristics of the Java HotSpot VM can be controlled by the use of command-line flags. See the documentation for the Java application launcher for Microsoft Windows or Solaris, Linux, or OS X.
  • Java HotSpot Virtual Machine Garbage Collection Tuning Guide describes the garbage collectors included with the Java HotSpot VM and helps you decide which garbage collector can best optimize the performance of your application, especially if it handles large amounts of data (multiple gigabytes), has many threads, and has high transaction rates.

Enhancements

  • Java Virtual Machine Enhancements in Java SE 8 and JDK 8
  • Java Virtual Machine Enhancements in JDK 7
  • Enhancements in JDK 6:
    • DTrace Probes
    • Garbage Collection Enhancements
      • Parallel Compaction
      • Concurrent Mark Sweep Collector Enhancements
      • Class Data Sharing
      • Server-Class Machine Detection
      • Garbage Collection Ergonomics
      • Thread Priority Changes
      • Virtual Machine Enhancements in JDK 1.4.2, 1.4.1 and 1.4.0

      More Information

      Источник

      Оку java virtual machine

      The Java ® programming language is a general-purpose, concurrent, object-oriented language. Its syntax is similar to C and C++, but it omits many of the features that make C and C++ complex, confusing, and unsafe. The Java platform was initially developed to address the problems of building software for networked consumer devices. It was designed to support multiple host architectures and to allow secure delivery of software components. To meet these requirements, compiled code had to survive transport across networks, operate on any client, and assure the client that it was safe to run.

      The popularization of the World Wide Web made these attributes much more interesting. Web browsers enabled millions of people to surf the Net and access media-rich content in simple ways. At last there was a medium where what you saw and heard was essentially the same regardless of the machine you were using and whether it was connected to a fast network or a slow modem.

      Web enthusiasts soon discovered that the content supported by the Web’s HTML document format was too limited. HTML extensions, such as forms, only highlighted those limitations, while making it clear that no browser could include all the features users wanted. Extensibility was the answer.

      The HotJava browser first showcased the interesting properties of the Java programming language and platform by making it possible to embed programs inside HTML pages. Programs are transparently downloaded into the browser along with the HTML pages in which they appear. Before being accepted by the browser, programs are carefully checked to make sure they are safe. Like HTML pages, compiled programs are network- and host-independent. The programs behave the same way regardless of where they come from or what kind of machine they are being loaded into and run on.

      A Web browser incorporating the Java platform is no longer limited to a predetermined set of capabilities. Visitors to Web pages incorporating dynamic content can be assured that their machines cannot be damaged by that content. Programmers can write a program once, and it will run on any machine supplying a Java run-time environment.

      1.2. The Java Virtual Machine

      The Java Virtual Machine is the cornerstone of the Java platform. It is the component of the technology responsible for its hardware- and operating system-independence, the small size of its compiled code, and its ability to protect users from malicious programs.

      The Java Virtual Machine is an abstract computing machine. Like a real computing machine, it has an instruction set and manipulates various memory areas at run time. It is reasonably common to implement a programming language using a virtual machine; the best-known virtual machine may be the P-Code machine of UCSD Pascal.

      The first prototype implementation of the Java Virtual Machine, done at Sun Microsystems, Inc., emulated the Java Virtual Machine instruction set in software hosted by a handheld device that resembled a contemporary Personal Digital Assistant (PDA). Oracle’s current implementations emulate the Java Virtual Machine on mobile, desktop and server devices, but the Java Virtual Machine does not assume any particular implementation technology, host hardware, or host operating system. It is not inherently interpreted, but can just as well be implemented by compiling its instruction set to that of a silicon CPU. It may also be implemented in microcode or directly in silicon.

      The Java Virtual Machine knows nothing of the Java programming language, only of a particular binary format, the class file format. A class file contains Java Virtual Machine instructions (or bytecodes ) and a symbol table, as well as other ancillary information.

      For the sake of security, the Java Virtual Machine imposes strong syntactic and structural constraints on the code in a class file. However, any language with functionality that can be expressed in terms of a valid class file can be hosted by the Java Virtual Machine. Attracted by a generally available, machine-independent platform, implementors of other languages can turn to the Java Virtual Machine as a delivery vehicle for their languages.

      The Java Virtual Machine specified here is compatible with the Java SE 8 platform, and supports the Java programming language specified in The Java Language Specification, Java SE 8 Edition.

      1.3. Organization of the Specification

      Chapter 2 gives an overview of the Java Virtual Machine architecture.

      Chapter 3 introduces compilation of code written in the Java programming language into the instruction set of the Java Virtual Machine.

      Chapter 4 specifies the class file format, the hardware- and operating system-independent binary format used to represent compiled classes and interfaces.

      Chapter 5 specifies the start-up of the Java Virtual Machine and the loading, linking, and initialization of classes and interfaces.

      Chapter 6 specifies the instruction set of the Java Virtual Machine, presenting the instructions in alphabetical order of opcode mnemonics.

      Chapter 7 gives a table of Java Virtual Machine opcode mnemonics indexed by opcode value.

      In the Second Edition of The Java ® Virtual Machine Specification, Chapter 2 gave an overview of the Java programming language that was intended to support the specification of the Java Virtual Machine but was not itself a part of the specification. In The Java Virtual Machine Specification, Java SE 8 Edition, the reader is referred to The Java Language Specification, Java SE 8 Edition for information about the Java programming language. References of the form: (JLS §x.y) indicate where this is necessary.

      In the Second Edition of The Java ® Virtual Machine Specification, Chapter 8 detailed the low-level actions that explained the interaction of Java Virtual Machine threads with a shared main memory. In The Java Virtual Machine Specification, Java SE 8 Edition, the reader is referred to Chapter 17 of The Java Language Specification, Java SE 8 Edition for information about threads and locks. Chapter 17 reflects The Java Memory Model and Thread Specification produced by the JSR 133 Expert Group.

      1.4. Notation

      Throughout this specification we refer to classes and interfaces drawn from the Java SE platform API. Whenever we refer to a class or interface (other than those declared in an example) using a single identifier N , the intended reference is to the class or interface named N in the package java.lang . We use the fully qualified name for classes or interfaces from packages other than java.lang .

      Whenever we refer to a class or interface that is declared in the package java or any of its subpackages, the intended reference is to that class or interface as loaded by the bootstrap class loader (§5.3.1).

      Whenever we refer to a subpackage of a package named java , the intended reference is to that subpackage as determined by the bootstrap class loader.

      The use of fonts in this specification is as follows:

      • A fixed width font is used for Java Virtual Machine data types, exceptions, errors, class file structures, Prolog code, and Java code fragments.
      • Italic is used for Java Virtual Machine «assembly language», its opcodes and operands, as well as items in the Java Virtual Machine’s run-time data areas. It is also used to introduce new terms and simply for emphasis.

      Non-normative information, designed to clarify the specification, is given in smaller, indented text.

      This is non-normative information. It provides intuition, rationale, advice, examples, etc.

      1.5. Feedback

      Readers are invited to report technical errors and ambiguities in The Java ® Virtual Machine Specification to jls-jvms-spec-comments@openjdk.java.net .

      Questions concerning the generation and manipulation of class files by javac (the reference compiler for the Java programming language) may be sent to compiler-dev@openjdk.java.net .

      Источник

      Читайте также:  Keyerror 1 в питоне
Оцените статью