网站策划制作,优秀网页设计排版,ps怎么做响应式网站布局图,网站设置的建设过程和准备阶段程序计数器
Program Counter Register程序计数器(寄存器)
程序计数器在物理层上是通过寄存器实现的
作用#xff1a;记住下一条jvm指令的执行地址特点 是线程私有的(每个线程都有属于自己的程序计数器)不会存在内存溢出
虚拟机栈
每个线程运行时所需要的内存称为虚拟机栈…程序计数器
Program Counter Register程序计数器(寄存器)
程序计数器在物理层上是通过寄存器实现的
作用记住下一条jvm指令的执行地址特点 是线程私有的(每个线程都有属于自己的程序计数器)不会存在内存溢出
虚拟机栈
每个线程运行时所需要的内存称为虚拟机栈每个栈由多个栈帧组成对应着每次方法调用时所占的内存每个线程只能有一个活动栈帧对应着当前正在执行的那个方法
栈内存溢出(StackOverflowError)
栈帧过多导致内存溢出栈帧过大导致内存溢出 java编译工具 jstack 线程id可以根据线程id找到有问题的线程进一步定位到有问题的代码行数 本地方法栈(Native Method stack)
java代码在完成一些需求时需要调用一些底层的如c/c代码那么就需要本地方法栈
例如hashCode()方法就是一个本地方法
public native int hashCode();/*** Indicates whether some other object is equal to this one.* p* The {code equals} method implements an equivalence relation* on non-null object references:* ul* liIt is ireflexive/i: for any non-null reference value* {code x}, {code x.equals(x)} should return* {code true}.* liIt is isymmetric/i: for any non-null reference values* {code x} and {code y}, {code x.equals(y)}* should return {code true} if and only if* {code y.equals(x)} returns {code true}.* liIt is itransitive/i: for any non-null reference values* {code x}, {code y}, and {code z}, if* {code x.equals(y)} returns {code true} and* {code y.equals(z)} returns {code true}, then* {code x.equals(z)} should return {code true}.* liIt is iconsistent/i: for any non-null reference values* {code x} and {code y}, multiple invocations of* {code x.equals(y)} consistently return {code true}* or consistently return {code false}, provided no* information used in {code equals} comparisons on the* objects is modified.* liFor any non-null reference value {code x},* {code x.equals(null)} should return {code false}.* /ul** p* An equivalence relation partitions the elements it operates on* into iequivalence classes/i; all the members of an* equivalence class are equal to each other. Members of an* equivalence class are substitutable for each other, at least* for some purposes.** implSpec* The {code equals} method for class {code Object} implements* the most discriminating possible equivalence relation on objects;* that is, for any non-null reference values {code x} and* {code y}, this method returns {code true} if and only* if {code x} and {code y} refer to the same object* ({code x y} has the value {code true}).** In other words, under the reference equality equivalence* relation, each equivalence class only has a single element.** apiNote* It is generally necessary to override the {link #hashCode() hashCode}* method whenever this method is overridden, so as to maintain the* general contract for the {code hashCode} method, which states* that equal objects must have equal hash codes.** param obj the reference object with which to compare.* return {code true} if this object is the same as the obj* argument; {code false} otherwise.* see #hashCode()* see java.util.HashMap*/