Question Best Practices - General Guidance On Memory Management and Retrieving Data from MSSQL

ckoeber

Member
Joined
Feb 29, 2012
Messages
5
Programming Experience
3-5
Hello,

I am looking for more general guidance on a peculiar issue I am having (and I am not sure if it is an issue or not).

I developed a Windows service that pulls data from one database (MS-SQL), inserts into an other database (Oracle), and then posts the results of the data being pulled from the MS-SQL database into a webserver using an httpwebrequest object.

Now, so far so good. Everything works.

When I leave the service running for a long time, however (like more than 24 hours), the memory that my application uses slowly creeps up and up. Initially my application starts off using approximately 50MB of memory and after 24 hours uses 110MB+. It constantly goes higher.

I make sure to call Close() and Dispose() for all of the objects that implement these methods and for objects that don't I set them to nothing.

Is this what I am supposed to be doing?

Also, in terms of pulling data from the database, I am using a data reader and then using a Do While MyDataReader.READ loop to iterate through the rows and filling instances of a custom class that way. Is that recommended?

Thank you for your time.
 
Back
Top