Garbage collection certainly doesn't sound like a particularly enticing subject, given that most associate it with dragging cans out to the sidewalk once a week. But garbage collection is an important a concept in software development, and it has offered critical memory management capabilities in platforms like Java and Microsoft's .Net. Yet the process can mean that applications pay a high price in terms of performance.
[ Is it time put the brakes on Java? InfoWorld columnist Neil McAllister explains why Java may have served its purpose. | Keep up to date on the latest in Java with the JavaWorld Enterprise Java newsletter. ]
The garbage collection challenge
In garbage collection, objects no longer used by a program are reclaimed, freeing up resources for the application and even the computer. But ironically, the act of garbage collection can tie up systems.
"Like many complex enterprise applications, we have a need to use large heaps for code in the JVM (Java Virtual Machine) cache. This often results in long garbage collection times. Severe 'stop the world' garbage collections can result in interruption of service," says Joey Caisse, CTO at News Digital Media.
"Java applications, especially in the enterprise sector [with many concurrent users, lots of data to be processed by the applications with low predictable latency], do suffer significantly from garbage collection," says Matthias Matook, CTO and architect at e-business service provider Ecetera.
The issues with garbage collection actually go back 30 years ago to programming languages like Lisp, says IDC analyst Al Hilwa. "The idea is to remove a cumbersome and error-prone process, namely memory management, from the hands of developers and automate it. When you automate something, you always are going to make trade-offs, but over time technology improves in such ways as to make these trade-offs only relevant in narrow circumstances."
How the new tools try to help
The Java runtime and the .Net framework offer automatic garbage collection technologies that help developers make fewer mistakes and overall write better code, Hilwa says. "These technologies have been critical in making custom software development mainstream in the enterprise. But for really demanding high-performance applications, the nature of garbage collection must be weighed carefully to ensure that nondeterministic pauses in application execution are not a problem."
Terracotta approaches the issue by bypassing Java garbage collection via its BigMemory product. Serving as an extended cache and a Java add-on to the company's Enterprise Ehcache product, BigMemory offers an in-process, off-heap cache for storing large amounts of data -- as much as 1TB. This improves memory utilization and application performance, the company says.
"Applications today are getting extremely large because of two things: One is the number of users they have to support, and two is the amount of data they have to support," says Terracotta CEO Amit Pandey. Web applications and their need to scale out have compounded the issue, he says. Although focused on Java today, Terracotta is working on similar technology for .Net.