MCPcopy Index your code
hub / github.com/questdb/questdb / recordMemAlloc

Method recordMemAlloc

core/src/main/java/io/questdb/std/Unsafe.java:434–444  ·  view source on GitHub ↗
(long size, int memoryTag)

Source from the content-addressed store, hash-verified

432 }
433
434 public static void recordMemAlloc(long size, int memoryTag) {
435 assert memoryTag >= 0 && memoryTag < MemoryTag.SIZE;
436 COUNTERS[memoryTag].add(size);
437 if (memoryTag >= MemoryTag.NATIVE_DEFAULT) {
438 final long mem = UNSAFE.getAndAddLong(null, RSS_MEM_USED_ADDR, size) + size;
439 assert mem >= 0 : "unexpected RSS mem: " + mem + ", size: " + size + ", memoryTag:" + memoryTag;
440 } else {
441 final long mem = UNSAFE.getAndAddLong(null, NON_RSS_MEM_USED_ADDR, size) + size;
442 assert mem >= 0 : "unexpected non-RSS mem: " + mem + ", size: " + size + ", memoryTag:" + memoryTag;
443 }
444 }
445
446 public static void setMemory(long address, long bytes, byte value) {
447 UNSAFE.setMemory(address, bytes, value);

Callers 15

closeMethod · 0.95
compileMethod · 0.95
closeMethod · 0.95
compileMethod · 0.95
allocMethod · 0.95
freeMethod · 0.95
updateMemoryUsageMethod · 0.95
freeMethod · 0.95
mallocMethod · 0.95
reallocMethod · 0.95
mmap0Method · 0.95
mremap0Method · 0.95

Calls 2

getAndAddLongMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected