Subject: Re: bug#20220: severe memory leak on emacs 24.4.1

From: Daniel Colascione <[email-masked]>
Date: Wed, 01 Apr 2015 00:53:56 -0700

On 03/31/2015 07:19 PM, Mario Valencia wrote:
>> However, I think that
>>"worthless" is too extreme, and not using it at all is too radical,
>>even if you can do nothing in terms of your system configuration to
>>bring down the amount of resources consumed by each invocation.  One
>>thread and 8 MB of memory is not that large, unless you really invoke
>>that command tens or times in a row.
> 
> You are wrong. Calling shellexecute tens of times is very common. Just
> consider when editing an html file, saving and viewing the file may
> happen more than once a minute, so in less than 30 minutes it will hit
> the bug. Or when opening files with an external application in dired, if
> you open more than 30 files with shellexecute, it will hit the bug,
> which is not unlikely. Afterwards, after quitting the debugger, a few
> more times of calling the function and emacs will hang permanently.

Whatever bit of code is starting a thread (or otherwise permanently
consuming resources) on ShellExecute is broken, not Emacs. I don't think
I've seen that behavior myself. What's the thread start function on that
new thread? What's on its stack?

Anyway, you should be able to work around the problem by using cmd.exe's
"start" builtin, which will run ShellExecute on your behalf.