[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


VB.NET Memory Problems Garbage Collection Not Working?

Posted on 2005-04-16
Medium Priority
Last Modified: 2012-08-14
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.
Question by:jimtxas
  • 2

Author Comment

ID: 13799849
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?

LVL 14

Accepted Solution

amyhxu earned 1500 total points
ID: 13799930
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")


Author Comment

ID: 14006968
This wasn't an exact answer to my problem but it sure helped the memory consumption problem....

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question