473,385 Members | 1,834 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.

Does it claim memory of Object when I use one reference for other objects?

string strSql;
DataTable tbl;
strSql = "Select * from tbl1";
tbl = this.GetRemoteObj().ExecuteDataSet(strSql, cnnStr).Tables[0]; // A.
..... do something with tbl..
strSql = "Select * from tbl2";
tbl = this.GetRemoteObj().ExecuteDataSet(strSql, cnnStr).Tables[0]; // B
..... do something with tbl..

.... repeat several times using tbl...

In this example, tbl is assigned on B. tbl now points to new object.
I thought that the object created on A lost reference, so it is marked as
eligible for garbage collection. But, I'm not sure about it since there is
lots of memory loss from my application when running the part.
I didn't call Dispose or set tbl=null; .
Then Does garbage collect reclaim the memory that tbl object created on A?
If so, when does it happen?
What is best pattern for the case that using one reference for different
objects repeatly?
Jul 21 '05 #1
0 955

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

Similar topics

31
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily...
30
by: Christian Seberino | last post by:
How does Ruby compare to Python?? How good is DESIGN of Ruby compared to Python? Python's design is godly. I'm wondering if Ruby's is godly too. I've heard it has solid OOP design but then...
16
by: bluekite2000 | last post by:
I want Matrix A(B) to create shallow copy of B but A=B to create deep copy of B. Is that bad design? Why and why not?
13
by: Jason Huang | last post by:
Hi, Would someone explain the following coding more detail for me? What's the ( ) for? CurrentText = (TextBox)e.Item.Cells.Controls; Thanks. Jason
0
by: GoodMorningSky | last post by:
string strSql; DataTable tbl; strSql = "Select * from tbl1"; tbl = this.GetRemoteObj().ExecuteDataSet(strSql, cnnStr).Tables; // A. ..... do something with tbl.. strSql = "Select * from tbl2";...
5
by: Mike S | last post by:
I'm working on a .NET application that was under development by a previous developer, who is no longer working with the company. The program basically extracts records from a source database and...
48
by: avasilev | last post by:
Hi all, my question is: if i allocate some memory with malloc() and later free it (using free()), is there a possibility that a consequent malloc() will allocate memort at the same starting...
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
19
by: Angus | last post by:
I have a socket class CTestClientSocket which I am using to simulate load testing. I create multiple instances of the client like this: for (int i = 0; i < 5; i++) { CTestClientSocket* pTemp...
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: 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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.