TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Srinivas Sripathi
NA
9
0
Deterministic deletion of the managed object
Apr 15 2011 2:44 AM
In .net, the unmanaged resources like file handles, database connections, etc... can be deleted or freed at any time through the dispose method. But there is no way for the determinstic deletion of the managed objects. The managed objects are deleted by the garbage collector only when it runs. we can not predict when the GC runs. It runs when the generations are full based on the generation algorithm. The main problem of not having the deterministic deletion of the managed objects to which there are no further references existing in the program is that they occupy the main memory unnecessarily till the time the GC runs even though there is no use of them.
The memory management job has been taken from the developer and given to the GC to get rid of 2 problems which troubled the unmanaged c++ programmers a lot. They are 1. Memory leaks and 2. Access violations.
The reason behind not providing the deterministic deletion of the managed objects to the developer is to avoid access violations. That is good and safe. But it causes the above problem. It would be better if there is any other approach to avoid the access vioaltions while providing a way to the developers to delete the managed objects.
Reply
Answers (
6
)
ListBox with DataTable
what is actual relation between ado.net & database?