Верификация кучи памяти объектов виртуальной машины

Аннотация

В настоящей статье рассмотрены алгоритмы верификации объектной кучи памяти (heap) виртуальной машины Java, а также разработан и реализован собственный алгоритм верификации объектной памяти на языке программирования С++, основанный на использовании собственных аллокаторов. Данный верификационный алгоритм обходит все объекты кучи, после чего применяет два этапа проверки ссылок на другие объекты в объектной памяти виртуальной машины специальными верификационными функциями. На первом этапе проверяется принадлежность ссылки к области памяти выделенной определённым аллокатором (специальной компонентой виртуальной машины, которая занимается выделением памяти под её различные структуры). На втором этапе, зная к какой области памяти, выделенной определённым аллокатором, принадлежит проверяемая ссылка, определяется непосредственно корректной данной ссылки. Данные этапы верификатора можно применять до и после работы сборщика мусора по опциям, подаваемым при запуске виртуальной машины. Такой алгоритм позволяет проверить правильность работы с виртуальной памятью как сборщика мусора, так и других компонент виртуальной машины, которые взаимодействуют с объектной кучей. Представленная работа является частью большого проекта компании Huawei Technologies Co. Ltd. по разработке виртуальной машины Java для мобильных устройств. Разработанный инструмент уже используется разработчиками компании для отлаживания ошибок времени выполнения и выявления недочётов работы с объектами в исходном коде программы. Для проверки правильности верификации реализован набор unit-тестов, покрывающий многочисленные ситуации работы с памятью виртуальной машины как правильные, так и заведомо ошибочные. Данный верификатор может совершенствоваться для увеличения скорости работы виртуальной машины и уменьшение воздействия на её работу.

Сведения об авторе

Igor Andreevich Petrov, Московский государственный университет имени М.В. Ломоносова

магистрант факультета вычислительной математики и кибернетики

Литература

1. Lee S.-M., Kim D.-G., Shin D.-R. General purpose hardware abstraction layer for multiple virtual machines in mobile devices. Proceedings of the 11th International Conference on Advanced Communication Technology (ICACT '09). IEEE Press, Phoenix Park; 2009. p. 362-364. (In Eng.)
2. Sivapriyan R., Sakshi N., Mahesh K. Intelligent Garbage Collection Application for Smart City. Proceedings of the International Conference on Advancements in Electrical, Electronics, Communication, Computing and Automation (ICAECA). IEEE Press, Coimbatore, India; 2021. p. 1-6. (In Eng.) DOI: https://doi.org/10.1109/ICAECA52838.2021.9675572
3. Rodriguez-Rivera G. Conservative garbage collection for general memory allocators. Proceedings of the 2nd international symposium on Memory management (ISMM '00). Association for Computing Machinery, New York, NY, USA; 2000. p. 71-79. (In Eng.) DOI: https://doi.org/10.1145/362422.362464
4. Agesen O., Detlefs D., Moss E. Garbage Collection and Local Variable Type-Precision and Liveness in Java Virtual Machines. ACM SIGPLAN Notices. 1998; 33(5):269-279. (In Eng.) DOI: https://doi.org/10.1145/277652.277738
5. Wimmer C., Mössenböck H. Automatic Feedback-Directed Object Inlining in the Java HotSpotTM Virtual Machine. Proceedings of the 3rd International Conference on Virtual Execution Environments (VEE '07). Association for Computing Machinery, New York, NY, USA; 2007. p. 12-21. (In Eng.) DOI: https://doi.org/10.1145/1254810.1254813
6. Shaham R., Kolodner E.K., Sagiv M. On effectiveness of GC in Java. Proceedings of the 2nd international symposium on Memory management (ISMM '00). Association for Computing Machinery, New York, NY, USA; 2000. p. 12-17. (In Eng.) DOI: https://doi.org/10.1145/362422.362430
7. Boehm H.-J. Reducing garbage collector cache misses, On effectiveness of GC in Java. Proceedings of the 2nd international symposium on Memory management (ISMM '00). Association for Computing Machinery, New York, NY, USA; 2000. p. 59-64. (In Eng.) DOI: https://doi.org/ 10.1145/362422.362438
8. Bacon D.F., Fink S.J., Grove D. An efficient parallel heap compaction algorithm. Proceedings of the 16th European Conference on Object-Oriented Programming (ECOOP '02). Springer-Verlag, Berlin, Heidelberg; 2002. p. 111-132. (In Eng.) DOI: https://doi.org/10.5555/646159.680023
9. Jones R.E., Ryder C. A Study of Java Object Demographics. Proceedings of the 7th international symposium on Memory management (ISMM '08). Association for Computing Machinery, New York, NY, USA; 2008. p. 121-130. (In Eng.) DOI: https://doi.org/10.1145/1375634.1375652
10. Barrett D.A., Zorn B.G. Using lifetime predictors to improve memory allocation performance. Proceedings of the ACM SIGPLAN 1993 conference on Programming language design and implementation (PLDI '93). Association for Computing Machinery, New York, NY, USA, 1993. p. 187-196. (In Eng.) DOI: https://doi.org/10.1145/155090.155108
11. Singh T. The Hotspot Java Virtual Machine: Memory and Architecture. International Journal of Allied Practice, Research and Review. 2014. p. 60-64. (In Eng.) DOI: https://doi.org/10.13140/2.1.2442.7206
12. Lattner C., Adve V. Automatic Pool Allocation: Improving Performance by Controlling Data Structure Layout in the Heap. Proceedings of the 2005 ACM SIGPLAN conference on Programming language design and implementation (PLDI '05). Association for Computing Machinery, New York, NY, USA; 2005. p. 129-142. (In Eng.) DOI: https://doi.org/10.1145/1065010.1065027
13. Novark G., Berger E.D. DieHarder: securing the heap. Proceedings of the 17th ACM conference on Computer and communications security (CCS '10). Association for Computing Machinery, New York, NY, USA; 2010. p. 573-584. (In Eng.) DOI: https://doi.org/10.1145/1866307.1866371
14. Silvestro S., Liu H., Crosser C., Lin Zh., Liu T. FreeGuard: A Faster Secure Heap Allocator. Proceedings of the 2017 ACM SIGSAC Conference on Computer and Communications Security (CCS '17). Association for Computing Machinery, New York, NY, USA; 2017. p. 2389-2403. (In Eng.) DOI: https://doi.org/10.1145/3133956.3133957
15. Soares A.M.M., de Sousa R.T.Jr. A Technique for Extraction and Analysis of Application Heap Objects within Android Runtime (ART). Proceedings of the 3rd International Conference on Information Systems Security and Privacy (ICISSP). Porto, Portugal; 2017. p. 147-156. (In Eng.) DOI: https://doi.org/10.5220/0006204101470156
16. Bhatia R., Saltaformaggio B., Yang S.J., Ali-Gombe A., Zhang X., Xu D., Richard III G.G. Tipped Off by Your Memory Allocator: Device-Wide User Activity Sequencing from Android Memory Images. Proceedings on Network and Distributed Systems Security (NDSS) Symposium 2018. San Diego, CA, USA; 2018. 15 p. (In Eng.) DOI: http://dx.doi.org/10.14722/ndss.2018.23324
17. Ogasawara T. An algorithm with constant execution time for dynamic storage allocation. Proceedings Second International Workshop on Real-Time Computing Systems and Applications. IEEE Press, Tokyo, Japan; 1995. p. 21-25. (In Eng.) DOI: https://doi.org/10.1109/RTCSA.1995.528746
18. Wilson P.R., Johnstone M.S., Neely M., Boles D. Dynamic Storage Allocation: A Survey and Critical Review. In: Ed. by H. G. Baler. Memory Management. IWMM 1995. Lecture Notes in Computer Science. 1995; 986:1-116. Springer, Berlin, Heidelberg. (In Eng.) DOI: https://doi.org/10.1007/3-540-60368-9_19
19. Masmano M., Ripoll I., Crespo A., Real J. TLSF: a new dynamic memory allocator for real-time systems. Proceedings of the 16th Euromicro Conference on Real-Time Systems (ECRTS 2004). IEEE Press, Catania, Italy; 2004. p. 79-88. (In Eng.) DOI: https://doi.org/10.1109/EMRTS.2004.1311009
20. Johnstone M.S., Wilson P.R. The memory fragmentation problem: solved? ACM SIGPLAN Notices. 1999; 34(3):26-36. (In Eng.) DOI: https://doi.org/10.1145/301589.286864
21. Bacon D.F., Cheng P., Rajan V.T. Controlling fragmentation and space consumption in the metronome, a real-time garbage collector for Java. Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems (LCTES '03). Association for Computing Machinery, New York, NY, USA; 2003. p. 81-92. (In Eng.) DOI: https://doi.org/10.1145/780732.780744
22. Grunwald D., Zorn B. CustoMalloc: efficient synthesized memory allocators. Software: Practice and Experience. 1993; 23(8):851-869. (In Eng.) DOI: https://doi.org/10.1002/spe.4380230804
23. Masmano M., Ripoll I., Real J., Crespo A., Wellings A.J. Implementation of a constant-time dynamic storage allocator. Software: Practice and Experience. 2008; 38(10):995-1026. (In Eng.) DOI: https://doi.org/10.1002/spe.858
24. Martínez-Bazan N., Ángel Águila-Lorente M., Muntés-Mulero V., Dominguez-Sal D., Gómez-Villamor S., Larriba-Pey J.-L. Efficient graph management based on bitmap indices. Proceedings of the 16th International Database Engineering & Applications Sysmposium (IDEAS '12). Association for Computing Machinery, New York, NY, USA; 2012. p. 110-119. (In Eng.) DOI: https://doi.org/10.1145/2351476.2351489
25. Qian F., Hendren L. An adaptive, region-based allocator for java. Proceedings of the 3rd international symposium on Memory management (ISMM '02). Association for Computing Machinery, New York, NY, USA; 2002. p. 127-138. (In Eng.) DOI: https://doi.org/10.1145/512429.512446
Опубликована
2021-09-30
Как цитировать
PETROV, Igor Andreevich. Верификация кучи памяти объектов виртуальной машины. Современные информационные технологии и ИТ-образование, [S.l.], v. 17, n. 3, p. 603-612, sep. 2021. ISSN 2411-1473. Доступно на: <http://sitito.cs.msu.ru/index.php/SITITO/article/view/787>. Дата доступа: 24 apr. 2024 doi: https://doi.org/10.25559/SITITO.17.202103.603-612.
Раздел
Исследования и разработки в области новых ИТ и их приложений