CICS, Tufts Researchers Develop Approach for Prioritizing Important Memory

Emery Berger

In a paper presented on Nov. 3 in Amsterdam, computer science researchers Emery Berger of the University of Massachusetts Amherst and Sam Guyer of Tufts University described a new programming language feature they say will help to make software applications faster. They spoke at the Association of Computing Machinery's Systems, Programming, Languages and Applications: Software for Humanity (SPLASH) conference.

Berger at UMass Amherst's College of Information and Computer Sciences and Guyer, with Tufts Ph.D. student Diogenes Nunez, developed the new feature they call "prioritized garbage collection" to improve performance in applications written in several commonly used programming languages. Their work is funded by the National Science Foundation and Google.  

As Berger explains, many applications save recently accessed and computed information in memory "caches" to make it faster to access in the future. Unfortunately, caching data doesn't necessarily make applications faster. For applications written in Java, used in servers and Android phones, and JavaScript used in browsers, a feature called "garbage collection" makes caching ineffective.

Garbage collection reclaims unused memory by repeatedly scanning over all memory looking for things no longer in use. The more items retained, the more work garbage collection has to do. This problem leaves programmers with the dilemma of how to decide how much data to cache, Berger says.

"If the cache is too small, they are sacrificing performance. If the cache is too big, it hurts performance because the system wastes more time doing garbage collection or ends up discarding memory that the application is currently using," he notes. Programmers currently have no way of figuring out what size is "just right," because the amount of memory a program uses is constantly changing, so there's not even one correct size, he adds.

In today's talk, the researchers show that they have made strides towards finding a solution to this long-standing problem by designing a technique that lets programs automatically use the right amount of memory to maximize performance.

Berger explains, "Our approach lets programmers assign a priority to memory objects. Low priority objects might be cached objects that are really old and unlikely to get used again, and high priority objects might be ones that are brand new." This "prioritized garbage collection" approach lets garbage collectors reclaim memory preferentially.

Guyer says, "Intuitively, this is like having your clothes organized in a closet where the clothes you most recently wore are in the front. It's a lot better for someone to clean out your closet and get rid of clothes you haven't worn in forever--they may not even fit anymore--instead of tossing your favorite shirt."

Manu Sridharan, a former researcher at IBM, says of the innovation, "We need this in Java yesterday. We've had a super annoying problem for years and never found a good solution."