new Scala() instance of Java: a comparison of the memory behaviour of Java and Scala programs

  • Authors:
  • Andreas Sewe;Mira Mezini;Aibek Sarimbekov;Danilo Ansaloni;Walter Binder;Nathan Ricci;Samuel Z. Guyer

  • Affiliations:
  • Technische Universität Darmstadt, Darmstadt, Germany;Technische Universität Darmstadt, Darmstadt, Germany;University of Lugano, Lugano, Switzerland;University of Lugano, Lugano, Switzerland;University of Lugano, Lugano, Switzerland;Tufts University, Medford, MA, USA;Tufts University, Medford, MA, USA

  • Venue:
  • Proceedings of the 2012 international symposium on Memory Management
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

While often designed with a single language in mind, managed runtimes like the Java virtual machine (JVM) have become the target of not one but many languages, all of which benefit from the runtime's services. One of these services is automatic memory management. In this paper, we compare and contrast the memory behaviour of programs written in Java and Scala, respectively, two languages which both target the same platform: the JVM. We both analyze core object demographics like object lifetimes as well as secondary properties of objects like their associated monitors and identity hash-codes. We find that objects in Scala programs have lower survival rates and higher rates of immutability, which is only partly explained by the memory behaviour of objects representing closures or boxed primitives. Other metrics vary more by benchmark than language.