Abstract
Managed programming languages like Java and C# perform resource management as a part of their language specification. They use a runtime system like JVM or CLR for the management. In contrast native languages like C and C++, designed to provide strong foundation for programs requiring speed or tight coupling with operating system or hardware, are used with manual resource management. These do not require the runtime system. Naturally, it will be nice to have a managed layer for native languages which can be plugged in as and when we want to manage resources in any point of time during execution. In this paper, we present a GC Pintool which automates the garbage collection for C programs at run time using PIN (a framework for dynamic binary instrumentation). Efficacy of the GC Pintool has been tested over various benchmark C programs and our GC approach using PIN is found to be correct and precise.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
“2.1. What Valgrind does with your program” in http://valgrind.org/docs/manual/manual-core.html.
- 2.
We needed to tweak the tool to report memory issues.
References
Cohen, J.: Garbage collection of linked data structures. Comput. Surv. 13(3), 341–367 (1981)
Cohen, J., Nicolau, Alexandru: Comparison of compacting algorithms for garbage collection. ACM Trans. Program. Lang. Syst. 5(4), 532–553 (1983)
Wilson, P., Johnstone, M., Neely, M., Boles, D.: Dynamic storage allocation: a survey and critical review. In: Proceedings of the International Workshop on Memory Management, Kinross Scotland (UK) (1995)
Jones, R.E.: Garbage collection: algorithms for automatic dynamic memory management. Wiley, Chichester (1996)
Harold McBeth, J.: On the reference counter method. Commun. ACM 6(9), 575 (1963)
McCarthy, John: Recursive functions of symbolic expressions and their computation by machine. Commun. ACM 3, 184–195 (1960)
Ungar, D.: Generation scavenging: a non-disruptive high performance storage reclamation algorithm. In: Proceedings of the ACM Symposium on Practical Software Development Environments, pp. 157–167 (1984)
Blackburn, S.M., Cheng, P., McKinley, K.-S.: Myths and reality: the performance impact of garbage collection. In: Sigmetrics—Performance 2004, Joint International Conference on Measurement and Modeling of Computer Systems, New York (2004)
Dijkstra, E.W., Lamport, L., Martin, A.J., Scholten, C.S., Steffens, E.F.M:. On-the-fly garbage collection: an exercise in cooperation. Commun. ACM 21(11), 965–975 (1978)
Boehm, H.-J.: Space efficient conservative garbage collection. In: Proceedings of the ACM SIGPLAN 1993 Conference on Programming Language Design and Implementation, pp. 197–206. ACM Press (1993)
Rafkind, J., Wick, A., Regehr, J., Flatt, M.: Precise garbage collection for C. In: Proceedings of ISMM 09 International Symposium on Memory Management, pp. 39–48. ACM Press (2009)
Boehm, H.-J.: Bounding space usage of conservative garbage collectors. In: Proceedings of the 29th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 93–100. ACM Press (2002)
Hirzel, M., Diwan, A., Henkel, J.: On the usefulness of type and liveness accuracy for garbage collection and leak detection. ACM Trans. Program. Lang. Syst. 24(6), 593–624 (2002)
Luk, C., Cohn, R., Muth, R., Patil, H., Klauser, A., Lowney, G., Wallace, S., Reddi, V.J., Pin, H.K.: Building customized program analysis tools with dynamic instrumentation. In: Proceedings of the 2005 ACM SIGPLAN Conference on Programming Language Design and Implementation (Chicago, IL, USA, June 12–15, 2005)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2016 Springer India
About this chapter
Cite this chapter
Chatterjee, N., Thakur, S.S., Das, P.P. (2016). Resource Management in Native Languages Using Dynamic Binary Instrumentation (PIN). In: Chaki, R., Cortesi, A., Saeed, K., Chaki, N. (eds) Advanced Computing and Systems for Security. Advances in Intelligent Systems and Computing, vol 396. Springer, New Delhi. https://doi.org/10.1007/978-81-322-2653-6_8
Download citation
DOI: https://doi.org/10.1007/978-81-322-2653-6_8
Published:
Publisher Name: Springer, New Delhi
Print ISBN: 978-81-322-2651-2
Online ISBN: 978-81-322-2653-6
eBook Packages: EngineeringEngineering (R0)