Skip to main navigation Skip to search Skip to main content

Learning-Based Dynamic Memory Allocation Schemes for Apache Spark Data Processing

  • Danlin Jia
  • , Li Wang
  • , Natalia Valencia
  • , Janki Bhimani
  • , Bo Sheng
  • , Ningfang Mi
  • College of Engineering
  • Florida International University

Research output: Contribution to journal › Article › peer-review

Abstract

Apache Spark is an in-memory analytic framework that has been adopted in the industry and research fields. Two memory managers, Static and Unified, are available in Spark to allocate memory for caching Resilient Distributed Datasets (RDDs) and executing tasks. However, we find that the static memory manager (SMM) lacks flexibility, while the unified memory manager (UMM) puts heavy pressure on the garbage collection of the JVM on which Spark resides. To address these issues, we design a learning-based bidirectional usage-bounded memory allocation scheme to support dynamic memory allocation with the consideration of both memory demands and latency introduced by garbage collection. We first develop an auto-tuning memory manager (ATuMm) that adopts an intuitive feedback-based learning solution. However, ATuMm is a slow learner that can only alter the states of Java Virtual Memory (JVM) Heap in a limited range. That is, ATuMm decides to increase or decrease the boundary between the execution and storage memory pools by a fixed portion of JVM Heap size. To overcome this shortcoming, we further develop a new reinforcement learning-based memory manager (Q-ATuMm) that uses a Q-learning intelligent agent to dynamically learn and tune the partition of JVM Heap. We implement our new memory managers in Spark 2.4.0 and evaluate them by conducting experiments in a real Spark cluster. Our experimental results show that our memory manager can reduce the total garbage collection time and thus further improve Spark applications' performance (i.e., reduced latency) compared to the existing Spark memory management solutions. By integrating our machine learning-driven memory manager into Spark, we can further obtain around 1.3x times reduction in the latency.

Original languageEnglish
Pages (from-to)13-25
Number of pages13
JournalIEEE Transactions on Cloud Computing
Volume12
Issue number1
DOIs
StatePublished - Jan 1 2024

ASJC Scopus Subject Areas

  • Software
  • Information Systems
  • Hardware and Architecture
  • Computer Science Applications
  • Computer Networks and Communications

Keywords

  • Apache Spark
  • distributed data processing
  • JVM memory management
  • machine learning
  • Q-learning

Fingerprint

Dive into the research topics of 'Learning-Based Dynamic Memory Allocation Schemes for Apache Spark Data Processing'. Together they form a unique fingerprint.

Cite this