Re: How to release heap memory that is marked as 'free'



"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,

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

Joseph M. Newcomer [MVP]
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
.



Relevant Pages

  • Re: Explorer unresponsive
    ... Jeff Stanton wrote: ... boxes before Peak Memory Usage and Virtual Memory size. ... Volume fragmentation ... Event Viewer: Event Type: Error ...
    (microsoft.public.windowsxp.basics)
  • Re: Explorer unresponsive
    ... Jeff Stanton wrote: ... boxes before Peak Memory Usage and Virtual Memory size. ... Volume fragmentation ... Event Viewer: Event Type: Error ...
    (microsoft.public.windowsxp.basics)
  • Re: Watching Virtual Memory
    ... where the undo feature will hold large amounts of information in memory ... files are often not easily defragmented by Disk Defragmenter. ... Is System Restore monitoring your D and E drives. ... Volume fragmentation ...
    (microsoft.public.windowsxp.general)
  • Re: Explorer unresponsive
    ... before Peak Memory Usage and Virtual Memory size. ... The Commit Charges figures from Task Manager are less than your RAM. ... Volume fragmentation ... the System and Application logs in Event Viewer for the last boot. ...
    (microsoft.public.windowsxp.basics)
  • Re: Explorer unresponsive
    ... before Peak Memory Usage and Virtual Memory size. ... Internet Explorer select Tools, Manage Add Ons, Enable or Disable Add ... Volume fragmentation ... the System and Application logs in Event Viewer for the last boot. ...
    (microsoft.public.windowsxp.basics)