Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Memory Leakage  RSS feed

 
Vallabhaneni Suresh Kumar
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is memory leakage possible in Java? If yes, can you describe a case in which memory leaks may occur, and what is the way to avoid that?

Thank you
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can Java applications leak memory?
http://jqa.tmorris.net/faq/GetQAndA.action?qids=38&showAnswers=true
 
Mahesh Pinnamaneni
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
as i have heard that Memory Leakage occures majorly applies to external resources like sockets or database connections etc..
But i didn't understand whether there is a chance of memory leakage due to un referenced objects in the memory which are not garbage collected?
if YES, then how to handle these kind of problems.
can any one give me an example to show how mem leake happens in case of objects.
thanks alot,
--Mahesh
 
Norm Radder
Ranch Foreman
Posts: 2220
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An example would be adding a listener and not removing it when its not needed or used or has been replaced by a new one
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!