The Artima Developer Community
Sponsored Link

Java Community News
Memory Leaks in J2EE Apps

1 reply on 1 page. Most recent reply: Mar 17, 2006 6:36 AM by Biagio Cosenza

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

Memory Leaks in J2EE Apps Posted: Mar 14, 2006 8:25 AM
Reply to this message Reply
Summary
Although memory leak possibilities in Java programs have been discussed and documented in recent years, a new article summarizes potential memory leak dangers in J2EE apps. The article provides a useful summary, although not everyone may agree with all its conclusions.
Advertisement
In his recent JavaWorld article, Ambily Pankajakshan enumerates some patterns that lead to leaking memory in a J2EE app. Among the causes he mentions are:
  • ResultSet and Statement objects
  • Collections
  • Static variables and classes
  • Singletons
  • HttpSession and HttpRequest
Do you agree with the article's recommendations? What other causes of memory leaks can you add to Ambily's list?


Biagio Cosenza

Posts: 3
Nickname: biacos
Registered: Nov, 2005

Re: Memory Leaks in J2EE Apps Posted: Mar 17, 2006 6:36 AM
Reply to this message Reply
Using java (and other other VM oriented platforms) we often forget important memory and resource management issues.
I think that the problem is more general: resource leaks in managed virtual machine.
Unknown or unwanted object references cause memory leaks AND resource leaks.

In a distributed system, resources like the bandwith used by a connection may weights more than the effective allocated memory.

The article raises an important question: a wrong use of design patterns may increase memory/resource leaks.

I disagree with this quote:
"... explicitly cleaning the heap may be a mandatory programming requirement in some applications; doing so must be considered on a case-by-case basis"
If cleaning the heap means to call System.gc(), this is a fairy tale. Artima docet: "System.gc() Is a Suggestion, not a Command",
http://www.artima.com/legacy/design/cleanup/messages/36.html

Last personal consideration: this is a little loss of "don't care of memory management" philosophy.

Flat View: This topic has 1 reply on 1 page
Topic: Memory Leaks in J2EE Apps Previous Topic   Next Topic Topic: A Wizard for Swing

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use