程序计数器、虚拟机堆栈和本地方法堆栈在创建和执行线程后创建和销毁。堆栈中的堆栈帧通过放大的入口和出口被推入和退出堆栈。在确定类结构时,分配给每个堆栈帧的内存量基本上是已知的,因此这些区域中的内存分配和循环是确定的。
[En]
The program counter, virtual machine stack, and local method stack are created and destroyed after the thread is created and executed. The stack frames in the stack are pushed in and out of the stack with the magnified entry and exit. The amount of memory allocated to each stack frame is basically known when the class structure is determined, so the memory allocation and recycling in these areas are deterministic.
Java堆中存放的所有对象的实例,只有在程序运行期间我们才会知道会创建哪些对象,这部分内存分配与回收都是动态的,垃圾收集器重点关注的就是这部分。
引入计数算数
向对象添加引用计数器。每次一个地方引用它时,计数器值将增加1;当参考失败时,计数器值减少1;计数器随时为0的对象不能再次使用。
[En]
Add a reference counter to the object. Each time a place references it, the counter value will be increased by 1; When the reference fails, the counter value decreases by 1; Objects whose counters are 0 at any time cannot be used again.
缺点:它很难解决对象之间的相互循环引用的问题。
VM ages:-XX:+PrintGCDetails 打印GC详细信息:
```
package memory;
public class ReferenceCountingGC {
public Object instance = null;
private static final int _1MB = 1024 *1024;
private byte[] bigSize = new byte[2 *_1MB];

基于easyx的小时钟

web监听器解析

datatimepicker插件

Spring Boot整合Swagger报错:”this.condition” is null

订单及其状态机的设计实现

PyScript:让Python在HTML中运行

Python模拟实现银行系统(平时的小练习)

Java(8)数组

AQS学习(一)自旋锁原理介绍(为什么AQS底层使用自旋锁队列?)

自己动手实现java数据结构(九) 跳表

关于ASP.NET WEB API(OWIN WEBAPI)的几个编码最佳实践总结

python函数

【特殊的阻塞队列】 java.util.concurrent.SynchronousQueue 源码分析

一文学会Java的交互式编程环境jshell
