Re: Preventing an application from staying in memory if closed improperly



"Scott M." <quanker@xxxxxxxxx> wrote in message news:1180031232.721684.137500@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I need some general advice on how to prevent my VB6 application from
remaining in memory after it has supposedly shut down.

VB apps end when all forms are unloaded and no code is running. Usually what you describe indicates that a form is still there. If it does this in the IDE it's often easy to debug by pausing the app and checking the Forms collection and using F8 to single-step any code still running.

If it doesn't happen in the IDE then you may need to add some code to the form_terminate event to log any entries in the Forms collection or check to see if there is any way a loop could still be processing.

Your Form_Unload event should make sure all forms are unloaded, all timers stopped, all external references (e.g. Word, Excel, other ActiveX objects) are released, and all files/databases/etc are closed.

Do NOT fall back to using END; that's a band-aid that can do more harm than good.

.



Relevant Pages

  • Re: Large Pages - Linux Foundation HPC
    ... -- Memory and interface to it - mapping memory into apps ... Some of their apps get a 6-7x speedup from large pages! ... Based on Dave's descriptions that HPC apps typically ... true of the kernel in general... ...
    (Linux-Kernel)
  • Re: Tech directions for Delphi?
    ... allocator, ... Most desktop apps build a relatively modest working set (a ... the case for .NET doesn't really rest on automatic memory ... management being cheaper overall than manual memory management. ...
    (borland.public.delphi.non-technical)
  • Re: Id appreciate your opinion(s)
    ... The fact that so much memory is used really doesn't mean you ... When it comes to all of the apps except for ones defined in the ... then I would say that .NET or Java are perfectly fine ... Java and .NET can both do "smart" clients, fat clients, or web-based ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: memory requirements of closed vs quit apps
    ... majority of programs remain open when all their windows are closed. ... they use bugger all memory - and are ... individual apps Real and Virtual memory entries. ... In order to push it out to swap, ...
    (uk.comp.sys.mac)
  • Re: memory requirements of closed vs quit apps
    ... Close those tabs. ... I'd imagine it's the OS just trying to work out which memory needs ... The UI thing is exacerbated by the behaviour of apps to ... IMO 1Gb of RAM should easily ...
    (uk.comp.sys.mac)