Современные информационные технологии и IT-образование (Sep 2021)

Object Memory Verification in Virtual Machines

  • Igor Petrov

DOI
https://doi.org/10.25559/SITITO.17.202103.603-612
Journal volume & issue
Vol. 17, no. 3
pp. 603 – 612

Abstract

Read online

In this paper we discuss object memory heap verification algorithms of the Java virtual machine and developed and implemented a proprietary object memory verification algorithm. This verification algorithm iterates over all heap objects, after which it applies two stages of checking references to other objects in the object memory of the virtual machine with special verification functions. At the first stage, it is checked that the reference to references to the memory area allocated by some allocator (a special component of the virtual machine that allocates memory for its various structures). At the second stage, knowing to which memory area allocated by some allocator the checked reference belongs, it is determined directly by the correct given reference. These stages of the verifier can be applied before and after the garbage collector by the options given when starting the virtual machine. This algorithm allows us to check that the garbage collector and other virtual machine components that interact with the object heap are working correctly with virtual memory. The developed tool is already used by the company's developers to debug run-time errors and identify shortcomings in working with objects in the program source code. To check the correctness of verification, a set of unit tests was implemented that covers many situations of working with the memory of a virtual machine, both correct and deliberately erroneous. This verifier can be improved to increase the speed of the virtual machine and reduce the impact on its operation.

Keywords