Re: memory issue
- From: Tom Esh <tjeshGibberish@xxxxxxxxxx>
- Date: Tue, 28 Jun 2005 22:43:37 -0400
On Tue, 28 Jun 2005 13:37:02 -0700, Ben
<Ben@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
>Here is my situation.
>
>At startup of my application, my app utilized 25MB of RAM. During run time,
>it automatically gone up to 50MB, which makes senses. However, after I clear
>out all of my data trees, reset everything, back to the beggining page. I
>still see 50MB stuck in Windows Task Manager. Yes, I am very positive I have
>dump all of my data container. No other 3rd party executable invoked my app
>is running either. It shouldn't automatically reset its memory usuage back
>to 25MB, right? But strangely, it doesn't. Could someonse please tell me if
>there is a default dll I could call to automatically strip away those
>memories not being used?
You can explicitly tell VB to unload dlls no longer in use with the
CoFreeUnusedLibraries Ole Api function. VB will (supposed to anyway)
do this itself periodically, but it can't hurt.
'declaration...
Public Declare Sub CoFreeUnusedLibraries Lib "ole32" ()
'usage...
CoFreeUnusedLibraries
DoEvents
Also the system will reclaim some resources when you minimize the
app's UI. Restoring it may increase usage again, but typically still
less than the previous level.
-Tom
MVP - Visual Basic
(please post replies to the newsgroup)
.
- Follow-Ups:
- Re: memory issue
- From: Casey Provance
- Re: memory issue
- References:
- memory issue
- From: Ben
- memory issue
- Prev by Date: Re: compile dll with specific guid?
- Next by Date: Re: Thanks
- Previous by thread: Re: memory issue
- Next by thread: Re: memory issue
- Index(es):