Automatic Removal of Array Memory Leaks in Java

  • Authors:
  • Ran Shaham;Elliot K. Kolodner;Shmuel Sagiv

  • Affiliations:
  • -;-;-

  • Venue:
  • CC '00 Proceedings of the 9th International Conference on Compiler Construction
  • Year:
  • 2000

Quantified Score

Hi-index 0.00

Visualization

Abstract

Current garbage collection (GC) techniques do not (and in general cannot) collect all the garbage that a program produces. This may lead to a performance slowdown and to programs running out of memory space. In this paper, we present a practical algorithm for statically detecting memory leaks occurring in arrays of objects in a garbage collected environment. No previous algorithm exists. The algorithm is conservative, i.e., it never detects a leak on a piece of memory that is subsequently used by the program, although it may fail to identify some leaks. The presence of the detected leaks is exposed to the garbage collector, thus allowing GC to collect more storage. We have instrumented the Java virtual machine to measure the effect of memory leaks in arrays. Our initial experiments indicate that this problem occurs in many Java applications. Our measurements of heap size show improvement on some example programs.