C++ Memory Safety and Integrity Evaluation
DOI:
https://doi.org/10.58445/rars.2876Keywords:
C, Memory, Safety, Java, EvaluationAbstract
C++ remains a dominant language for performance-critical systems, yet its reliance on manual memory management from the developer introduces significant safety risks. Memory leaks and dangling pointers can result in a constant increase in memory usage, eventually making a system crash. Such leaks and errors can also allow malicious individuals to access the internal RAM of the system and change any data as they choose, making such errors extremely dangerous and a security liability. This paper will evaluate the memory safety and integrity/stability of C++, focusing on the latter mentioned common vulnerabilities. Through a custom benchmarking suite, the study assesses the trade-offs between performance and safety while using several features and programming techniques. This analysis highlights the effectiveness and limitations of current mitigation techniques, offering insights into the feasibility of securing C++ applications without compromising their runtime or memory usage, along with a comparison with a standard managed language, Java.
References
A. Younan, W. Joosen, and Katholieke U., Security of Memory Allocators for C and C++, Journal of Secure Software Engineering, pp. 123-145, 2005.
B. Giorgio, Memory Integrity Techniques for Memory-Unsafe Languages: A Survey, Sant’Anna School of Advanced Studies, Jan. 2024.
A. Babati and P. Pataki, Comprehensive Performance Analysis of C++ Smart Pointers, Journal of Software Engineering and Applications, vol. 12, no. 3, pp. 14-25, 2017.
D. Ivalyo, Applying RAII Resource Management Idiom in C++, St. Cyril and St. Methodius University of Veliko Tarnovo, Nov. 2015.
A. Stepanov and D. Serebryany, MemorySanitizer: Fast Detector of Uninitialized Memory Use in C++, Proc. 13th Int. Symp. Code Generation and Optimization (CGO), pp. 102-113, 2015.
D. Serebryany et al., Memory Tagging and How It Improves C/C++ Memory Safety, Google Research, 2018.
S. Zehra et al., Comparative Analysis of C++ and Python in Terms of Memory and Time, Journal of Computer Science and Technology, vol. 15, no. 7, pp. 200-212, Dec. 2020.
A. Chatzigeorgiou, Performance and power evaluation of CPP object-oriented programming in embedded processors, University of Macedonia, 2015.
G. Kandasamy Sengottaiyan and Tarik Eltaeib, Memory Management in C++ and Java, University of Bridgeport, pp. 3-5, 2015.
B. Oancea and et al., Evaluating Java performance for linear algebra numerical computations, Nicolae Titulescu University, 2010.
I. Plauska, Performance Evaluation of C/C++, MicroPython, Rust and TinyGo Programming Languages on ESP32 Microcontroller, Kaunas University of Technology, 2022.
P. Wu and F. Wang, On Efficiency and Optimization of C++ Programs, National Chiao Tung University, 1996.
A. Georges et al., Statistically Rigorous Java Performance Evaluation, Ghent University, 2007.
Downloads
Posted
Categories
License
Copyright (c) 2025 Venkata Sai Smaran Vallabhaneni

This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.