• Home
  • Search
  • A volatile-by-default JVM for server applications
  • Cite Icon12
  • https://doi.org/10.1145/3133873Copy DOI Icon

A volatile-by-default JVM for server applications

Show More
  • Abstract
  • Literature Map
  • References
  • Citations
  • Similar Papers
Abstract

A *memory consistency model* (or simply *memory model*) defines the possible values that a shared-memory read may return in a multithreaded programming language. Choosing a memory model involves an inherent performance-programmability tradeoff. The Java language has adopted a *relaxed* (or *weak*) memory model that is designed to admit most traditional compiler optimizations and obviate the need for hardware fences on most shared-memory accesses. The downside, however, is that programmers are exposed to a complex and unintuitive semantics and must carefully declare certain variables as `volatile` in order to enforce program orderings that are necessary for proper behavior. This paper proposes a simpler and stronger memory model for Java through a conceptually small change: *every* variable has `volatile` semantics by default, but the language allows a programmer to tag certain variables, methods, or classes as `relaxed` and provides the current Java semantics for these portions of code. This *volatile-by-default* semantics provides *sequential consistency* (SC) for all programs by default. At the same time, expert programmers retain the freedom to build performance-critical libraries that violate the SC semantics. At the outset, it is unclear if the `volatile`-by-default semantics is practical for Java, given the cost of memory fences on today's hardware platforms. The core contribution of this paper is to demonstrate, through comprehensive empirical evaluation, that the `volatile`-by-default semantics is arguably acceptable for a predominant use case for Java today -- server-side applications running on Intel x86 architectures. We present VBD-HotSpot, a modification to Oracle's widely used HotSpot JVM that implements the `volatile`-by-default semantics for x86. To our knowledge VBD-HotSpot is the first implementation of SC for Java in the context of a modern JVM. VBD-HotSpot incurs an average overhead versus the baseline HotSpot JVM of 28% for the Da Capo benchmarks, which is significant though perhaps less than commonly assumed. Further, VBD-HotSpot incurs average overheads of 12% and 19% respectively on standard benchmark suites for big-data analytics and machine learning in the widely used Spark framework.

Similar Papers
  • Research Article
  • Citations1

Automated Robustness Verification of Concurrent Data Structure Libraries against Relaxed Memory Models

  • Oct 08, 2024
  • Proceedings of the ACM on Programming Languages
  • Kartik Nagar +3
  • Conference Article
  • Citations8

Defining uniform and hybrid memory consistency models on a unified framework

  • Jan 05, 1999
  • A.C.M Alves De Melo
  • Research Article

Decidability of Liveness on the TSO Memory Model

  • Feb 13, 2026
  • Formal Aspects of Computing
  • Chao Wang +5
  • Research Article
  • Citations43

HRF-Relaxed

  • Apr 16, 2015
  • ACM Transactions on Architecture and Code Optimization
  • Benedict R Gaster +2
  • Conference Article

Visualizing Execution Histories on Multiple Memory Consistency Models

  • Sep 28, 1998
  • Alba Cristina Magalhães De Melo +1
  • Research Article
  • Citations9

Scalability Analysis of Memory Consistency Models in NoC-Based Distributed Shared Memory SoCs

  • Jan 01, 2013
  • IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems
  • A Naeem +2
  • Conference Article
  • Citations52

Synthesizing memory models from framework sketches and Litmus tests

  • Jun 14, 2017
  • James Bornholt +1
  • Research Article
  • Citations11

Synthesizing memory models from framework sketches and Litmus tests

  • Jun 14, 2017
  • ACM SIGPLAN Notices
  • James Bornholt +1
  • Research Article
  • Citations86

Location consistency-a new memory model and cache consistency protocol

  • Jan 01, 2000
  • IEEE Transactions on Computers
  • G.R Gao +1
  • Conference Article
  • Citations48

Maximal causality reduction for TSO and PSO

  • Oct 19, 2016
  • Shiyou Huang +1
  • Conference Article
  • Citations94

Automatic fence insertion for shared memory multiprocessing

  • Jun 23, 2003
  • Xing Fang +2
  • Conference Article
  • Citations74

Lamport clocks

  • Jan 01, 1998
  • Manoj Plakal +3
  • Research Article
  • Citations3

A regulated transitive reduction (RTR) for longer memory race recording

  • Oct 20, 2006
  • ACM SIGOPS Operating Systems Review
  • Min Xu +2
  • Research Article
  • Citations1

A regulated transitive reduction (RTR) for longer memory race recording

  • Oct 20, 2006
  • ACM SIGPLAN Notices
  • Min Xu +2
  • Research Article
  • Citations6

A regulated transitive reduction (RTR) for longer memory race recording

  • Oct 20, 2006
  • ACM SIGARCH Computer Architecture News
  • Min Xu +2
Cactus Communications logo

Copyright 2026 Cactus Communications. All rights reserved.