voltdb off heap内存的一点代码
时间:2021-07-01 10:21:17
帮助过:4人阅读
= Cleaner.create(
this,
new Deallocator(m_tokens, bytes));
private static class Deallocator
implements Runnable {
private long address;
private int size;
public Deallocator(
long address,
int size) {
this.address =
address;
this.size =
size;
}
@Override
public void run() {
if (address == 0
) {
return;
}
Bits.unsafe.freeMemory(address);
address = 0
;
m_allocatedHashinatorBytes.addAndGet(-
size);
}
}
http://www.docjar.com/docs/api/sun/misc/Unsafe.html
http://www.docjar.com/docs/api/sun/misc/Cleaner.html
voltdb off heap内存的一点代码
标签:res ret 内存 and nat int creat ted address