• XSS.stack #1 – первый литературный журнал от юзеров форума

адреса ячеек памяти/переменные/jvm

p4p4

(L1) cache
Пользователь
Регистрация
04.04.2024
Сообщения
504
Реакции
276
Можно ли получить информацию об адресе ячейки памяти,в которой хранится переменная?
Если да, то как это сделать(существуют ли готовые решения - тулзы?), какие ограничения существуют?(как обойти данные ограничения?)
если такое возможно реализовать, то как в случае с динамической аллокацией памяти быть? - так называемая "хронология" записи может быть отсележна - куда копать в сторону сборщика?
сборщик не логирует работу с датой в памяти, какими средствами отследить изменения ?
 
Most GCs move objs in memory (compacting, defrag heaps) for perf. If Java exposed stable obj addrs, that would constrain the GC’s ability to move shit around. JIT compiler + opts will eliminate/rearrange objs + local vars in registers, on the stack etc. The notion of a single “memory address” will be meaningless from the viewpoint of these optimizations.
There is no standard Java log that says “Obj X was moved from addr A to addr B at time T.”

JOL uses HotSpot internals/instr to "estimate" obj layout + addrs: how fields are laid out + approx. offset of objs relative to some base addr.
JVMTI is a "native" interface: “official” low-level interface for debuggers, profilers.

 
Most GCs move objs in memory (compacting, defrag heaps) for perf. If Java exposed stable obj addrs, that would constrain the GC’s ability to move shit around. JIT compiler + opts will eliminate/rearrange objs + local vars in registers, on the stack etc. The notion of a single “memory address” will be meaningless from the viewpoint of these optimizations.
There is no standard Java log that says “Obj X was moved from addr A to addr B at time T.”

JOL uses HotSpot internals/instr to "estimate" obj layout + addrs: how fields are laid out + approx. offset of objs relative to some base addr.
JVMTI is a "native" interface: “official” low-level interface for debuggers, profilers.

thx mate!
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх