运行时数据区的各个异常
1 | 运行时数据区 :是一个规范 |
1 | 谈谈你遇到过的常见的[JVM相关]的异常信息? |
Java Virtual Machine Stacks
The following exceptional conditions are associated with Java Virtual Machine stacks:
If the computation in a thread requires a larger Java Virtual Machine stack than is permitted, the Java Virtual Machine throws a StackOverflowError.
If Java Virtual Machine stacks can be dynamically expanded, and expansion is attempted but insufficient memory can be made available to effect the expansion, or if insufficient memory can be made available to create the initial Java Virtual Machine stack for a new thread, the Java Virtual Machine throws an OutOfMemoryError.
1 | StackOverflowError: |
Heap
1 | “堆管存储 栈管执行” |
1 |
|
1.Boolean类型
1 | public class XXAPP { |
1 | ok 看一下 上面程序用的是 |
2.非Boolean类型
1 | 先查看 metaspace 大小 |
1 | 这就是 非Boolean类型的 |
1 | 我们再看一个 |
1 | 15 表示 一个对象年纪多大了 |
1 | 代码直接报错: |
1 | ok 会使用了吧 |
1 | [double_happy@hadoop101 ~]$ java -XX:+PrintFlagsFinal -version >> flags.txt |
1 | 1.初始化的 堆的大小 |
1 | [double_happy@hadoop101 ~]$ jps |
1 | 4.stack 大小 |
继续异常:
1 | java.lang.outofMemoryError:GC overhea limit exceeded |
1 | Full GC 1023->1023 表示已经干不掉了 |
1 | 2. 先看一个类 nio |
1 | allocate这个方法 分配JVM内存 |
1 | 结果: |
1 | 3. |
1 | ------3419 |
1 | 4. |