Skip to main content

Resource Management in Native Languages Using Dynamic Binary Instrumentation (PIN)

  • Chapter
  • First Online:
Advanced Computing and Systems for Security

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    “2.1. What Valgrind does with your program” in http://valgrind.org/docs/manual/manual-core.html.

  2. 2.

    We needed to tweak the tool to report memory issues.

References

  1. Cohen, J.: Garbage collection of linked data structures. Comput. Surv. 13(3), 341–367 (1981)

    Article  MathSciNet  Google Scholar 

  2. Cohen, J., Nicolau, Alexandru: Comparison of compacting algorithms for garbage collection. ACM Trans. Program. Lang. Syst. 5(4), 532–553 (1983)

    Article  Google Scholar 

  3. 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)

    Google Scholar 

  4. Jones, R.E.: Garbage collection: algorithms for automatic dynamic memory management. Wiley, Chichester (1996)

    MATH  Google Scholar 

  5. Harold McBeth, J.: On the reference counter method. Commun. ACM 6(9), 575 (1963)

    Article  Google Scholar 

  6. McCarthy, John: Recursive functions of symbolic expressions and their computation by machine. Commun. ACM 3, 184–195 (1960)

    Article  MATH  Google Scholar 

  7. 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)

    Google Scholar 

  8. 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)

    Google Scholar 

  9. 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)

    Google Scholar 

  10. 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)

    Google Scholar 

  11. 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)

    Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Article  Google Scholar 

  14. 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)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Nachiketa Chatterjee .

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics