摘要: Resolution:简单地说就是将符号引用转化为直接引用。 在JVM指令集中,anewarray, checkcast, getfield,getstatic, instanceof, invokedynamic, invokeinterface, invokespecial, invokesta 阅读全文
posted @ 2021-01-16 13:28 ppjj 阅读(93) 评论(0) 推荐(0) 编辑
摘要: 类(如果无特殊说明,本文中的“类”表示类和接口,下同)的初始化主要包括初始化的同步及执行其初始化方法<clinit>。 在以下几种情况下会触发类的初始化: (1)执行JVM指令:new、getstatic、putstatic、invokestatic,会触发指令后的引用所指向类的初始化(若未初始化) 阅读全文
posted @ 2021-01-16 13:26 ppjj 阅读(82) 评论(0) 推荐(0) 编辑
摘要: 方法区(Method Area)与Java堆一样,是各个线程共享的内存区域,它用于存储已被虚拟机加载的类信息、常量、静态变量、即时编译器编译后的代码等数据。虽然Java虚拟机规范把方法区描述为堆的一个逻辑部分,但是它却有一个别名叫做Non-Heap(非堆),目的应该是与Java堆区分开来。对于习惯在 阅读全文
posted @ 2021-01-16 13:24 ppjj 阅读(208) 评论(0) 推荐(0) 编辑
摘要: For each type it loads, a Java Virtual Machine must store the following kinds of information in the method area: 对每个装载的类型,虚拟机都会在方法区中存储以下类型信息: The full 阅读全文
posted @ 2021-01-16 13:22 ppjj 阅读(376) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-01-16 13:20 ppjj 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 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 o 阅读全文
posted @ 2021-01-16 13:19 ppjj 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-01-16 13:18 ppjj 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-01-16 13:17 ppjj 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-01-16 13:16 ppjj 阅读(94) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2021-01-16 13:14 ppjj 阅读(195) 评论(0) 推荐(0) 编辑
摘要: As an example of how the Java Virtual Machine uses the information it stores in the method area, consider these classes: 为了展示虚拟机如何使用方法区中的信息,我们举个例子,看下面 阅读全文
posted @ 2021-01-16 13:12 ppjj 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 对于大多数应用来说,Java堆(Java Heap)是Java虚拟机所管理的内存中最大的一块。Java堆是被所有线程共享的一块内存区域,在虚拟机启动时创建。此内存区域的唯一目的就是存放对象实例,几乎所有的对象实例都在这里分配内存。这一点在Java虚拟机规范中的描述是:所有的对象实例以及数组都要在堆上 阅读全文
posted @ 2021-01-16 13:10 ppjj 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 程序计数器(Program Counter Register)是一块较小的内存空间,它的作用可以看做是当前线程所执行的字节码的行号指示器。在虚拟机的概念模型里(仅是概念模型,各种虚拟机可能会通过一些更高效的方式去实现),字节码解释器工作时就是通过改变这个计数器的值来选取下一条需要执行的字节码指令,分 阅读全文
posted @ 2021-01-16 13:09 ppjj 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 与程序计数器一样,Java虚拟机栈(Java Virtual Machine Stacks)也是线程私有的,它的生命周期与线程相同。虚拟机栈描述的是Java方法执行的内存模型:每个方法被执行的时候都会同时创建一个栈帧(Stack Frame①)用于存储局部变量表、操作栈、动态链接、方法出口等信息。每 阅读全文
posted @ 2021-01-16 13:08 ppjj 阅读(173) 评论(0) 推荐(0) 编辑
摘要: The stack frame has three parts: local variables, operand stack, and frame data. The sizes of the local variables and operand stack, which are measure 阅读全文
posted @ 2021-01-16 13:07 ppjj 阅读(141) 评论(0) 推荐(0) 编辑
摘要: 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 variable 阅读全文
posted @ 2021-01-16 13:05 ppjj 阅读(572) 评论(0) 推荐(0) 编辑
摘要: 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, t 阅读全文
posted @ 2021-01-16 13:04 ppjj 阅读(353) 评论(0) 推荐(0) 编辑
摘要: In addition to the local variables and operand stack, the Java stack frame includes data to support constant pool resolution, normal method return, an 阅读全文
posted @ 2021-01-16 13:02 ppjj 阅读(411) 评论(0) 推荐(0) 编辑
摘要: jstat命令可以查看堆内存各部分的使用量,以及加载类的数量。命令的格式如下: jstat [-命令选项] [vmid] [间隔时间/毫秒] [查询次数] 注意!!!:使用的jdk版本是jdk8. 类加载统计: Loaded:加载class的数量 Bytes:所占用空间大小 Unloaded:未加载 阅读全文
posted @ 2021-01-16 12:55 ppjj 阅读(251) 评论(0) 推荐(0) 编辑
摘要: 1,MySQL左连接查询并分页,可能右边表不存在满足查询条件需要的数据,应该返回空列表,但是左边表有数据就会返回数据,不符合实际情况的需求,这时需要先在左边表里先用exists子句来关联右边表中的某个字段的查询条件来判断是否存在右边表中的数据,如果不存在就返回空列表数据,这时就满足需求了,除非右边表 阅读全文
posted @ 2021-01-16 12:54 ppjj 阅读(265) 评论(0) 推荐(0) 编辑