An object lives as long as there exists any references to it.
The garbage collector will every so often check all objects to see if they
are still referenced, and if not, release it and any other objects this
object references.
For web application things are slightly different.
The lifespan is still basically the same, but your "form" will terminate
once it is made and sent to the user, and the "application" will terminate
when there is no session holding it alive. Objects references will
therefore end and the objects will be released. You can store objects as
Session or Application variables to use accross pages and sessions.
--
Using M2, Opera's revolutionary e-mail client:
http://www.opera.com/m2/
For a laugh, try web browsing with Opera's User Mode and Nostalgia enabled