473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Creation and destruction objects

Hi to all,

I would like to know how .net manage the objects and what are the cicle of life of the objects...
Are the same this cicle, for the objects created in windows applications and for the web applications?

Any help will be grateful
Thank
Owatona

Nov 15 '05 #1
3 1687
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
Nov 15 '05 #2
Hi owatona,

The lifetime of objects in NET apps is managed by the .NET
garbage collector. Please try this link - It gives a good
overview of the garbage collector.
http://www.msdnaa.net/Resources/Display.aspx?ResID=601

Regards,
Aravind C

"owatona" <an*******@discussions.microsoft.com> wrote in message
news:26**********************************@microsof t.com...
Hi to all,

I would like to know how .net manage the objects and what are the cicle of life of the objects... Are the same this cicle, for the objects created in windows applications and for the web applications??
Any help will be grateful.
Thanks
Owatona.

Nov 15 '05 #3
Morten.... To be clear, an object is also eligible for garbage
collection
when is is unreachable, so two isolated objects can hold references to
each other (circular references) and still be marked for garbage
collection.

Regards,
Jeff
An object lives as long as there exists any references to it.<

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Richard | last post by:
Hi all, I am looking for some help on understanding the overhead associated with object creation in Java. I am writing an application where I have written a class to encapsulate some text...
0
by: Stephan Keil | last post by:
Hi all, consider a class class X { static X& OneX() { static X sgl1; return sgl1; } static X& TheX() { static X sgl2(OneX()); return sgl2; } }; and two source files with global variables
14
by: Jim Langston | last post by:
Which is more efficient (if either) MyHugeClass MyObject; for ( int i = 0; i < 1000; ++i ) { MyObject = SomeVal; Use MyObject; }
35
by: Maxim Yegorushkin | last post by:
The following code: #include <iostream> class base { private: virtual ~base() { std::cout << "virtual ~base()\n";
6
by: Charles Law | last post by:
As a matter of practice, where would people put the following elements of object creation/initialisation: Create shared member objects Initialise shared member objects Create non-shared member...
9
by: plahey | last post by:
I have been dabbling in Python for a while now. One of the things that really appeals to me is that I can seem to be able to use C++-style RAII idioms to deal with resource management issues. ...
5
by: Parapura Rajkumar | last post by:
hey all class A { }; class B {
5
by: cctv.star | last post by:
I need to maintain certain data structure, shared by all instances of a class, declared as . This data structure must change whenever a new object is created or an existing object is destroyed. So...
31
by: Tom P. | last post by:
I am doing quite a bit of custom painting and it means I have to create a lot of brushes (think one for every file system object in a directory) per paint. How expensive is this? Should I find a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.