Zurück zur Übersicht

new Scala() instance of Java: A Comparison of the Memory Behaviour of Java and Scala programs

Publikationsart Peer-reviewed
Publikationsform Originalbeitrag (peer-reviewed)
Publikationsdatum 2012
Autor/in Sewe Andreas, Mezini Mira, Sarimbekov Aibek, Ansaloni Danilo, Binder Walter, Ricci Nathan, Guyer Samuel Z.,
Projekt FAN: Foundations of dynamic program ANalysis
Alle Daten anzeigen

Originalbeitrag (peer-reviewed)

Zeitschrift ACM SIGPLAN Notices
Volume (Issue) 47(11)
Seite(n) 97 - 108
Titel der Proceedings ACM SIGPLAN Notices
DOI 10.1145/2426642.2259010


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.