
jvm
文章平均质量分 68
denverj
这个作者很懒,什么都没留下…
展开
-
JVM学习笔记-方法区(Method Area)
方法区(Method Area)与Java堆一样,是各个线程共享的内存区域,它用于存储已被虚拟机加载的类信息、常量、静态变量、即时编译器编译后的代码等数据。虽然Java虚拟机规范把方法区描述为堆的一个逻辑部分,但是它却有一个别名叫做Non-Heap(非堆),目的应该是与Java堆区分开来。 对于习惯在HotSpot虚拟机上开发和部署程序的开发者来说,很多人愿意把方法区称为“永久...原创 2011-10-25 09:21:59 · 292 阅读 · 0 评论 -
JVM学习笔记-特殊字符串(Special Strings)
Special Strings 特殊字符串The symbolic references contained in the constant pool involve three special kinds of strings: fully qualified names, simple names, and descriptors. All symbolic refe...原创 2011-11-05 14:33:00 · 240 阅读 · 0 评论 -
JVM学习笔记-Class文件(Class File)
What is a Java Class File?The Java class file is a precisely defined binary file format for Java programs. Each Java class file represents a complete description of one Java class or i...原创 2011-11-05 14:39:47 · 244 阅读 · 0 评论 -
JVM学习笔记-字段(Fields)
Each field (class variable and instance variable) declared in a class or interface is described by a field_info table in the class file. The format of the field_info table is shown in Table 6...原创 2011-11-07 11:17:08 · 220 阅读 · 0 评论 -
JVM学习笔记-方法(Methods)
MethodsEach method declared in a class or interface or generated by the compiler is described in the class file by a method_info table. The two types of compiler-generated methods that ma...原创 2011-11-07 11:25:30 · 177 阅读 · 0 评论 -
JVM学习笔记-属性(Attributes)
AttributesAs mentioned above, attributes appear in several places inside a Java class file. They can appear in the ClassFile, field_info, method_info, and Code_attribute tables. The Code_at...原创 2011-11-07 12:03:33 · 302 阅读 · 0 评论 -
JVM学习笔记-属性格式(Attributes Types)
AttributesThe Java Virtual Machine specification defines eight types of attributes, shown in Table 6-25. All Java Virtual Machine implementations must recognize three of these attributes:...原创 2011-11-07 12:15:44 · 197 阅读 · 0 评论 -
JVM学习笔记-动态连接和解析(Dynamic Linking and Resolution)
When you compile a Java program, you get a separate class file for each class or interface in your program. Although the individual class files may appear to be independent, they actually harbo...原创 2011-11-08 11:09:07 · 791 阅读 · 0 评论 -
JVM学习笔记-引用计数收集器(Reference Counting Collectors)
Reference Counting Collectors Reference counting was an early garbage collection strategy. In this approach, a reference count is maintained for each object on the heap. When an object is...原创 2011-11-22 15:46:51 · 201 阅读 · 0 评论 -
JVM学习笔记-跟踪收集器(Tracing Collectors)
Tracing CollectorsTracing garbage collectors trace out the graph of object references starting with the root nodes. Objects that are encountered during the trace are marked in some way. M...原创 2011-11-22 16:04:34 · 294 阅读 · 0 评论 -
JVM学习笔记-压缩收集器(Compacting Collectors)
Compacting CollectorsGarbage collectors of Java Virtual Machines will likely have a strategy to combat heap fragmentation. Two strategies commonly used by mark and sweep collectors are co...原创 2011-11-22 16:17:17 · 159 阅读 · 0 评论 -
JVM学习笔记-拷贝收集器(Copying Collectors)
Copying CollectorsCopying garbage collectors move all live objects to a new area. As the objects are moved to the new area, they are placed side by side, thus eliminating any free space t...原创 2011-11-22 16:34:56 · 246 阅读 · 0 评论 -
JVM学习笔记-分代收集器(Generational Collectors)
Generational CollectorsOne disadvantage of simple stop and copy collectors is that all live objects must be copied at every collection. This facet of copying algorithms can be improved up...原创 2011-11-23 14:41:53 · 171 阅读 · 0 评论 -
JVM学习笔记-调用Java方法(Invoking a Java Method)
Invoking a Java Method As mentioned in Chapter 5, "The Java Virtual Machine," the virtual machine creates a new stack frame for each Java (not native) method it invokes. The stack frame contai...原创 2011-11-25 11:35:28 · 359 阅读 · 0 评论 -
JVM学习笔记-本地方法栈(Native Method Stacks)
本地方法栈(Native Method Stacks)与虚拟机栈所发挥的作用是非常相似的,其区别不过是虚拟机栈为虚拟机执行Java方法(也就是字节码)服务,而本地方法栈则是为虚拟机使用到的Native方法服务。虚拟机规范中对本地方法栈中的方法使用的语言、使用方式与数据结构并没有强制规定,因此具体的虚拟机可以自由实现它。甚至有的虚拟机(譬如Sun HotSpot虚拟机)直接就把本地方法栈和虚拟...原创 2011-11-02 10:16:49 · 504 阅读 · 0 评论 -
JVM学习笔记-帧数据区(Frame Data)
In addition to the local variables and operand stack, the Java stack frame includes data to support constant pool resolution, normal method return, and exception dispatch. This data is stored i...原创 2011-10-28 09:16:39 · 434 阅读 · 0 评论 -
JVM学习笔记-操作数栈(Operand Stack)
Like the local variables, the operand stack is organized as an array of words. But unlike the local variables, which are accessed via array indices, the operand stack is accessed by pushing and...原创 2011-10-27 11:12:50 · 510 阅读 · 0 评论 -
JVM学习笔记-类型信息(Type Information)
For each type it loads, a Java Virtual Machine must store the following kinds of information in the method area: 对每个装载的类型,虚拟机都会在方法区中存储以下类型信息:The fully qualified name of the type这个类型的全限定名...原创 2011-10-25 09:50:14 · 255 阅读 · 0 评论 -
JVM学习笔记-常量池(Constant Pool)
For each type it loads, a Java Virtual Machine must store a constant pool. A constant pool is an ordered set of constants used by the type, including literals (string, integer, and floating...原创 2011-10-25 09:50:54 · 1692 阅读 · 0 评论 -
JVM学习笔记-字段信息(Field Information)
For each field declared in the type, the following information must be stored in the method area. In addition to the information for each field, the order in which the fields are declared by th...原创 2011-10-25 09:51:02 · 204 阅读 · 0 评论 -
JVM学习笔记-方法信息(Method Information)
For each method declared in the type, the following information must be stored in the method area. As with fields, the order in which the methods are declared by the class or interface must be ...原创 2011-10-25 09:51:17 · 164 阅读 · 0 评论 -
JVM学习笔记-类(静态)变量(Class Variables)
Class variables are shared among all instances of a class and can be accessed even in the absence of any instance. These variables are associated with the class--not with instances of the class...原创 2011-10-26 16:46:53 · 194 阅读 · 0 评论 -
JVM学习笔记-指向ClassLoader类的引用(A Reference to Class ClassLoader)
For each type it loads, a Java Virtual Machine must keep track of whether or not the type was loaded via the primordial class loader or a class loader object. For those types loaded via a class...原创 2011-10-26 16:47:05 · 158 阅读 · 0 评论 -
JVM学习笔记-指向Class类的引用(A Reference to Class Class)
An instance of class java.lang.Class is created by the Java Virtual Machine for every type it loads. The virtual machine must in some way associate a reference to the Class instance for a type ...原创 2011-10-26 16:47:21 · 292 阅读 · 0 评论 -
JVM学习笔记-方法区示例与常量池解析(Method Area Use And Constant Pool Resolution)
As an example of how the Java Virtual Machine uses the information it stores in the method area, consider these classes:为了展示虚拟机如何使用方法区中的信息,我们举个例子,看下面这个类:begin// On CD-ROM in file jvm/ex2/La...原创 2011-10-26 16:47:52 · 157 阅读 · 0 评论 -
JVM学习笔记-堆(Heap)
对于大多数应用来说,Java堆(Java Heap)是Java虚拟机所管理的内存中最大的一块。Java堆是被所有线程共享的一块内存区域,在虚拟机启动时创建。此内存区域的唯一目的就是存放对象实例,几乎所有的对象实例都在这里分配内存。这一点在Java虚拟机规范中的描述是:所有的对象实例以及数组都要在堆上分配①,但是随着JIT编译器的发展与逃逸分析技术的逐渐成熟,栈上分配、标量替换②优化...原创 2011-10-26 16:48:06 · 347 阅读 · 0 评论 -
JVM学习笔记-程序计数器(The Program Counter)
程序计数器(Program Counter Register)是一块较小的内存空间,它的作用可以看做是当前线程所执行的字节码的行号指示器。在虚拟机的概念模型里(仅是概念模型,各种虚拟机可能会通过一些更高效的方式去实现),字节码解释器工作时就是通过改变这个计数器的值来选取下一条需要执行的字节码指令,分支、循环、跳转、异常处理、线程恢复等基础功能都需要依赖这个计数器来完成。 ...原创 2011-10-27 10:18:24 · 381 阅读 · 0 评论 -
JVM学习笔记-栈(Stack)
与程序计数器一样,Java虚拟机栈(Java Virtual Machine Stacks)也是线程私有的,它的生命周期与线程相同。虚拟机栈描述的是Java方法执行的内存模型:每个方法被执行的时候都会同时创建一个栈帧(Stack Frame①)用于存储局部变量表、操作栈、动态链接、方法出口等信息。每一个方法被调用直至执行完成的过程,就对应着一个栈帧在虚拟机栈中从入栈到出栈的过程。...原创 2011-10-27 10:28:08 · 210 阅读 · 0 评论 -
JVM学习笔记-栈帧(The Stack Frame)
The stack frame has three parts: local variables, operand stack, and frame data. The sizes of the local variables and operand stack, which are measured in words, depend upon the needs of each i...原创 2011-10-27 10:35:23 · 171 阅读 · 0 评论 -
JVM学习笔记-局部变量区(Local Variables)
The local variables section of the Java stack frame is organized as a zero-based array of words. Instructions that use a value from the local variables section provide an index into the zero...原创 2011-10-27 10:42:21 · 440 阅读 · 0 评论 -
JVM学习笔记-本地方法调用(Invoking a Native Method)
Invoking a Native MethodAs mentioned in Chapter 5, "The Java Virtual Machine," the virtual machine invokes native methods in an implementation dependent manner. When invoking a native me...原创 2011-11-25 11:56:37 · 220 阅读 · 0 评论