Results 1 to 12 of 12

Thread: VS.NET 2003 getting slower....

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    VS.NET 2003 getting slower....

    Hi,

    Because of my poor coding skills, I always debug in VS.NET 2003, and need to run my code again and again. My code usually retrieve data from sql server using dataadapter, and do some processing on the datatable.

    I notice that the VS.NET response slower and slower as I use for one-two days, and the vm consumption in task manager is around 2xxMB.

    So, I constantly need to close and open VS.NET project in order to improve performance.

    Is there any way to prevent this? Pls help......

  2. #2
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: VS.NET 2003 getting slower....

    i think there is a memory leak in your code.

    what is a memory leak, well it is a part of code that uses a lot of memory and doesn't clean this memory before getting out of scope. and as you know the gc (Garbage collector) don't clean memory resources or datatabase resources instantly, in fact according to microsoft it has no rule for when to start.

    i think you are missing to close a sql connection after using. this way when you run the project several times (for debugging as you mentioned), you leave several connections open to the datatabase. at a point sql server may refuse to open a new connection because it's connection pool is empty. so it must wait until one of your forgotten connections is closed by gc (usually in 2 minutes).

    my advise, revise your code and check out for any sql connection that you dont close. you must close it after usage.

    good luck

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Re: VS.NET 2003 getting slower....

    Hi,

    As you mention, if there are some un-closed connection, since I'm in debugging stage, my code will stop suddenly or break by myself. I can't guarantee if the connection can be closed.

    Is there any best practice for this?

    Thx!

  4. #4
    .NUT jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    105,437

    Re: VS.NET 2003 getting slower....

    You should be using exception handling (Try...Catch...Finally...End Try) and be closing connections, etc. in the Finally block. That is exactly what it is for: to guarantee that cleanup is performed regardless of what may happen.

    Having said that, once your app's process is destroyed all open connections etc. should be closed implicitly and resources released. It's while your app is running that continually using resources and not releasing them that might cause a problem.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Mar 2001
    Posts
    416

    Re: VS.NET 2003 getting slower....

    Will the Finally block execute even I stop the execution by clicking "Stop" button on the toolbar?

  6. #6
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: VS.NET 2003 getting slower....

    No, I believe there is a memory issue in 2003. I even noticed this when writting a new app that had now connections to the db yet, nothing fancy, all basic controls and instianciations, etc. If I leave the IDE open for a day or more (program not running, only IDE open) when I go back to it it just crawls for a few minutes before things seem to catch back up to normal speeds. I leave my system on for months at a time without rebooting and I see that I at times am running over a MB in memory with nothing really running. This is supossed to be fixed in 05.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: VS.NET 2003 getting slower....

    Will the Finally block execute even I stop the execution by clicking "Stop" button on the toolbar?
    Of course not,

    the finally block will be executed if you have errors or if you don't have errors (Exceptions). it will be executed after the try block no matters what happens. but if u stopped execution this will terminate the program.

    usually finally block is used for cleanup code to make sure that resources will be released no matter what happens on execution .

  8. #8
    Fanatic Member dom_stapleton's Avatar
    Join Date
    Sep 2005
    Location
    Leigh-on-Sea, UK
    Posts
    665

    Re: VS.NET 2003 getting slower....

    I have noticed that VS 2003 also seems to freeze for a few seconds while I am working with it. I'll be typing some code or moving a control and it will suddenly go catatonic for a bit, this can be quite irritating. This is without using any data adapters or unclosed connections. I have not noticed the same behaviour in 2005 Express yet!
    I use Microsoft Visual Basic 2008 Express Edition.

    If my post has been helpful, please rate it, unless you don't believe in Karma... which actually I don't!

    Resources:
    Visual Basic Tutorials (1, 2) | MSDN Library | Google | Krugle | Search Forums

    Free components:
    Windows Forms Components | XP Common Controls Library

  9. #9
    Frenzied Member maged's Avatar
    Join Date
    Nov 2002
    Location
    Egypt
    Posts
    1,040

    Re: VS.NET 2003 getting slower....

    The IDE of visual studio 2003 is slow and in the IDE of 2002, it was handicapped. i think vs2005 IDE has the most stable and fast IDE in .net till now.

  10. #10
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: VS.NET 2003 getting slower....

    I cant wait to install 2005 still.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  11. #11
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,383

    Re: VS.NET 2003 getting slower....

    If you minimize an instance of the VS IDE (or any app written in .NET) you will notice memory consumption drops dramatically....

    I am not positive, but perhaps an explicit call is made to the GC when an app goes iconic (minimized).

    Once you restore the window, you will see the memory consumption rise a bit again, but generally it will stay lower than it was for some time.

    I often close/reopen visual studio if it has been open for longer than maybe 2-3 days just because I feel its good practice to do so, to make sure anything that could possibly be leaking, can start fresh.

    I know that both 2003 and 2005 are getting service packs which I heard will fix some issues in the IDEs, but I am not sure of any specifics. Memory leaks are often fixed in service releases though, as they are always a pretty major concern.

  12. #12
    Super Moderator RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,713

    Re: VS.NET 2003 getting slower....

    Well it just drives me nuts when I see one instance of the ide sucking up about a Gig of memory. Ive had the same instance of the ide open for over a month now.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width