Re: [Mingw-users] CRT lib: potential memory leakage
- Date: Sat, 6 May 2017 04:26:17 +0200
- From: Emanuel Falkenauer <E.Falkenauer@xxxxxxxxxxxxxxxxx>
- Subject: Re: [Mingw-users] CRT lib: potential memory leakage
On 05-May-17 21:00, Eli Zaretskii wrote:
>> Somehow I expected that answer - which is precisely why I said "it
>> accumulates over multiple runs of the same binary". If it really worked
>> as you say (and probably should), then the same memory should be reused
>> in all the runs after the first, i.e. NOT accumulate into gigs of RAM.
> I don't understand what you mean by "accumulated over multiple runs of
> the same binary".
Simple: run (and exit!) it ten times and you end up with ten times of
its allocated RAM marked as unavailable.
> The OS has no way of knowing whether the same
> binary will be run again once its process terminates, so it cannot
> keep that process's memory "reserved" when the process no longer
> exists. Moreover, modern Windows systems randomize the memory of a
> binary, so each run of the same binary will have different addresses
> allocated to it for the same code calling 'malloc'. In this
> situation, accumulating memory over multiple runs makes even less
I do agree with you - except it's simply NOT what we are experiencing.
I mentioned "the same binary" because there was in the past a "feature"
in Win that kept DLLs in the RAM even after the parent process exited,
supposedly for being able to activate them without the overhead of
loading again from the disc - Borland's DLLs were famous for that. But
I confess I don't know whether that's still a "feature" in the latest Win.
> Once again, please show your evidence, in the form of running a
> program and looking at the system memory with some tool, which would
> show that some of the memory which was allocated by a process calling
> 'malloc' is still marked as used after it terminates. I'm quite sure
> you draw erroneous conclusions from whatever observations you made,
> but it's impossible to point out specific mistakes without knowing the
I'll try to produce a convincing SIMPLE example (our stuff is not only
classified, but really heavy) - keep you posted.
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
MinGW-users mailing list
This list observes the Etiquette found at
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
You may change your MinGW Account Options or unsubscribe at: