VB.NET Memory Problems Garbage Collection Not Working?

I am a .NET newbie and am having a lot of memory problems.  Im primarily working with ADODB.NET and some other .NET controls for FTPing.  The utility is on a time to query a database every 10 minutes or so and executes some FTP functions based on query results.  The problem is after several hours of running memory on the box is largely consumed and Windows starts reporting paging problems and resizing.

I've cleaned up all of my objects the best I can find.  Disposing of the disposable ones and setting all other obeject and varibles to nothing after each process execution.  I've been doing some research on the GC.Collect method and have sprinkled it in some of my loops with no luck.

I have noticed that minimizing the console app cleans my memory utilization significanlty.  Just for grins, I have my time maximizing my form when it begins its processing and minimizing upon completion.  This seems to work for a while in cleaning up the memory problems but I am CERTAIN this isn't the best solution.

Let me know ANYTHING I could do to manage memory a bit better.
Who is Participating?
amyhxuConnect With a Mentor Commented:
I usually use dataset.clear to clear all the data and then refill the dataset, not sure if that will help reduce the memory tho:
  myDA.Fill(myDS, "gFTP_gLOG")
  myDA2.Fill(myDS2, "gFTP_gTRK")

jimtxasAuthor Commented:
Some other noticable items....

In checking the incremental memory utilization with minimizing the window, this doesn't appear to be working either.  It cakes memory utilization down to 2mb or so when minimized but incrementally gets larger when maximized.

I commented out a refresh function I am calling for 2 datagrids on my form each time the app runs and the memory utilization seems somwhat stable (<1k increase per iteration) if I do not perform these refreshes.   Here's the code in my refresh...

        'myDA.Fill(myDS, "gFTP_gLOG")
        'myDA2.Fill(myDS2, "gFTP_gTRK")

        'f.DataGrid2.DataSource = myDS2.Tables(0)
        'f.DataGrid1.DataSource = myDS.Tables(0)

What can I do to clean this up but keep my datagrids up to date?

jimtxasAuthor Commented:
This wasn't an exact answer to my problem but it sure helped the memory consumption problem....
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.