Design Pattern: Multi Key Lock (aka AND condition)
2016-06 | **** stars
Tech Bytes: Unravelling the Stack
2012-06 | **** stars
Review: The 'Dabangg' Debacle
2010-10 | ** stars
Outer Space, Inner Space
2008-10 | *** stars
Pride and Prejudice
2008-10 | ** stars
War of Emotions
2008-10 | ** stars
Team Psychology
2008-10 | *** stars
Dance of Emotions
2008-09 | ** stars
A Common Dilemma
2008-09 | ** stars
SQLite: A Truly Open Source Endeavor
2008-07 | ** stars
The 'IBCD' Face of New India
2008-06 | *** stars
Subtle Confessions (of my friends)
2008-06 | *** stars
(Fr)Agile Software Development
2008-06 | ***** stars
Is Microsoft past its glory
2008-05 | *** stars
Feminine Traits
2008-04 | ***** stars
Problem in Paris
2008-04 | *** stars
Book Review: Why Men Don't Listen and Why Women Can't Read Maps
2008-04 | **** stars
Managerial Traits
2008-03 | **** stars
Idol Worship
2008-03 | ** stars
Be Natural = Be Different
2008-03 | ** stars
The Scariest Moment of My Life
2008-03 | **** stars
Powered by Attitude, Driven by Hormones?
2008-02 | **** stars
Tech Bytes: Memory Loss in Java
2008-02 | ** stars
If Software Developers built an Airplane...
2007-11 | ** stars
The Wild Goose Chase
2007-10 | ***** stars
Developers are from Mars, Testers are from Venus!
2007-10 | *** stars
Tech Bytes: 'Resurrecting' Objects in Java
2007-09 | *** stars
Democracy - The Biggest Hoax of Modern Times
2007-09 | ** stars
Atomic Architecture
2007-08 | **** stars
Carefree Software Development
2007-08 | ***** stars
Taj Mahal - A Beautiful Scar
2007-07 | *** stars
Performance based Evaluation - A Review
2007-07 | ** stars
Author: Kiran
• Tuesday, February 12, 2008
Java is supposed to be an automatic memory managed environment. Or simply said, you can allocate memory and just forget to dispose it, explicitly. The virtual machine would take care of releasing it – a benign gesture towards a developer who can now afford to be more forgetful (without the fear of causing memory leaks), and hence more productive (?). Ignorance is Bliss!

But, there’s a catch! Of course, the virtual machine is not so smart. It does a fairly reasonable calculation to decide whether to release i.e., when there are no more references to that memory, it can be released. This implies that the memory is not recovered unless you nullify all the references to it.

Further, in case of real-world applications, with thousands of classes, it is highly likely that there might be some unknown stale references that are still lurking around in memory, preventing that memory from being recovered.

In essence, if the developer forgets to release all the references, it will not be reclaimed. It is not at all as benign as it was touted to be, after all. You still cannot afford to be forgetful - You have to nullify all those damn references!!
This entry was posted on Tuesday, February 12, 2008 and is filed under , . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response , or trackback from your own site.

0 comments :