Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 12th, 2005, 10:32 AM
Friend of Wrox
Join Date: Jun 2003
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Garbage Collection Issue in Time Sensitive Program

I've written a VB.NET Windows based application that runs full time on several machines. It acts like a time clock, collecting information on when employees arrive at and leave work. It consists of a login screen which is always displayed when the program is not being used, and other screens that are only loaded when necessary.

On occasion, when the program has not been used for a while, it takes as much as 30 seconds to load the second screen displayed once the user clears the login screen. As the time an employee arrives at work effects when they may leave, this delay is causing concern amongst employees who queue up to sign in for the day because they may have to work a whole minute longer (gasp!).

I believe this delay is related to garbage collection - either GC is running when this delay occurs and the program is getting insufficient CPU to load the next form, or the form has to be run through the JIT again because the last instance was disposed. I may be mistaken on the last statement, as I was thinking that perhaps if an object was disposed but not cleand up, it could be re-used without recompiling and .NET may nto be able to do that, but it was a thought I had trying to explain this delay.

I'm looking for ways to minimize GC so it does not impact the performance of the program (which is practically the only thing running on the computer). I've searched the web and the consensus seems to be that there is no way to either prevent GC, which is probably not desirable except for the most anal of developers, or even schedule it to only run at certain times. I'd try giving higher priority to the program and lower priority to GC, except they appear to run in the same thread which would seem to make that not possible. I suppose I could retain copies of all the forms in memory at all times, but would a lack of reference still invoke garbage collection?

Does anybody have information contrary to this? If not, is there anything you can suggest to improve performance at these times?

Similar Threads
Thread Thread Starter Forum Replies Last Post
Garbage Collection azizur123 .NET Framework 2.0 1 February 3rd, 2008 11:16 AM
Garbage collection in VC++ chandugsekhar BOOK: Beginning Visual C++ 6 0 October 18th, 2006 12:09 PM
Garbage Collection... kk_katepally General .NET 1 December 21st, 2004 04:18 AM
garbage collection can't work? gkb Pro PHP 1 July 31st, 2003 02:06 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.