Re: How to release heap memory that is marked as 'free'
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Tue, 18 Apr 2006 11:14:34 -0400
"put the bad actor in a sandbox, then change the sand"
ROTL!
Yes, this is a good solution.
joe
On Mon, 17 Apr 2006 12:06:29 -0500, Kurt Grittner <grittkmg_NO_SPAM_@xxxxxxxxxxx> wrote:
Hi Michael,Joseph M. Newcomer [MVP]
If your VBS/ADODB code is behaving badly with regard to heap
fragmentation and you don't control the code then you can do little
except to put it in a process by itself, then periodically let that
process exit (thereby freeing all of its memory and the associated
fragmentation), then reload it. You could use a memory mapped file to
connect to it. You could use registered Windows messages to trigger
events.
In other words, put the bad actor in a sandbox, then change the sand
periodically.
Hope this helps,
-Kurt
On Sun, 16 Apr 2006 13:31:38 -0400, "Michael Evenson"
<mevenson@xxxxxxxxxxxx> wrote:
Joe,
I installed a trial copy of BoundsChecker and it found absolutely no
memory leaks. I removed the heap walker calls and put in a heapstat function
that I call instead from within the loop where I feel the memory is getting
fragmented. All the heapstat function does is traverse the heap adding up
the used and freed blocks into separate accumlators. I then output these
values every 100 times through the loop. Both accumulators keep growing in
size (about 7K for the used memory for every 100 records processed - the
freed size seems to stabalize around 500+KB). I am using the ZipArchive
library, ADODB and the VisualBasic Scripting host in the loop. The scripting
host is used to massage the output, ADODB is getting a piece of data from a
database, and ZipArchive is compressing the output record. I thought that
there might be a leak in one of these pieces, but according to
BoundsChecker, there is not. They just seem to be fragmenting the crap out
of the memory. I'm going to have to re-think the memory allocation that I'm
using, but I don't have much control over ZipArchive (but some), and I have
absolutely no control over ADODB or the VBS host engine. The count of the
number of records processed is now over 410,000 per day and growing.
Thanks for all your input. It is greatly appreciated.
Mike
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
--
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
.
- References:
- How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Ajay Kalra
- Re: How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Tom Serface
- Re: How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Joseph M . Newcomer
- Re: How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Joseph M . Newcomer
- Re: How to release heap memory that is marked as 'free'
- From: Michael Evenson
- Re: How to release heap memory that is marked as 'free'
- From: Kurt Grittner
- How to release heap memory that is marked as 'free'
- Prev by Date: Re: Open a hard disk repertory with a MFC
- Next by Date: Function to send a file by ethernet
- Previous by thread: Re: How to release heap memory that is marked as 'free'
- Next by thread: Re: How to release heap memory that is marked as 'free'
- Index(es):
Relevant Pages
|