🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.vb.bugs
Article #5

Re: memory leak using VBA6 and file access

#5
From: Dev Ashish
Date: Wed, 29 Aug 2001 12:35
29 lines
2526 bytes
[ followup set to microsoft.public.office.developer.vba ]

Martin E. Muehlmann wrote:

> loop 20000 times:
>     1. VBA app writes textfile w/ data. (sequential mode)
>     2. C program reads it and processes data
>     3. C program writes output textfile
>     4. VBA app read output file (sequential and binary mode)
> next
> 
> The problem is that I call this C program tousends of times and after
> each iteration I have less free resources.

If you are really sure that the C program is not causing the leaks, then 
you'll have to post your VBA code (that does the above) before anyone here 
can offer suggestions. It could be as simple as you not closing the shelled 
instances (which might be open in hidden mode), or it could be a lang. bug 
(doubt it).

As for the redesign, it really depends on what you are trying to do.  
Depending on the data size & type, and if you are the author of the C app, 
you could try switching to calling stdcall convention functions from VBA 
(which probably would be the fastest way).  You could also use memory mapped 
files and passing the pointers back and forth. As you can see, chances of 
you causing leaks increase as you step away from the VBA layer. I would 
definitely reconsider the file IO data exchange method though, FWIW.

  -- Dev
Technical Details
Message-ID: <OrVmmcIMBHA.1560@tkmsftngp03>
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newscore.gigabell.net!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp03
References: <yG_i7.26585$KE4.3528529@carnaval.risq.qc.ca>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fde1d,83d952307302d24d
X-Google-Attributes: gidfde1d,public
X-Google-Thread: fc5c4,83d952307302d24d
X-Google-Attributes: gidfc5c4,public
X-Google-Thread: fcf3e,83d952307302d24d
X-Google-Attributes: gidfcf3e,public
X-Google-Thread: f7a67,83d952307302d24d
X-Google-Attributes: gidf7a67,public
X-Google-Thread: 10229f,83d952307302d24d
X-Google-Attributes: gid10229f,public
X-Google-ArrivalTime: 2001-08-29 05:39:22 PST
Subject: Re: memory leak using VBA6 and file access
From: Dev Ashish <dev@nomail.please>
References: <yG_i7.26585$KE4.3528529@carnaval.risq.qc.ca>
Organization: Your Company
Followup-To: microsoft.public.office.developer.vba
User-Agent: Xnews/4.06.22
Message-ID: <OrVmmcIMBHA.1560@tkmsftngp03>
Newsgroups: microsoft.public.vb.bugs,basicworld.public.vb.allgemein,microsoft.public.de.vb,microsoft.public.office.developer.vba,microsoft.public.word.vba.general
Date: Wed, 29 Aug 2001 05:35:55 -0700
NNTP-Posting-Host: 207.88.134.226
Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!isdnet!newscore.gigabell.net!newsfeed00.sul.t-online.de!t-online.de!tkmsftngp01!tkmsftngp03
Lines: 1