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

From: Eli Zaretskii <[email-masked]>
Date: Wed, 01 Apr 2015 17:25:10 +0300

> Date: Wed, 01 Apr 2015 00:50:48 -0700
> From: Daniel Colascione <[email-masked]>
> CC: [email-masked]
> 
> Do we need the lisp thread to be the main thread? What about calling
> CreateThread very early in initialization with a large dwStackSize,
> leaving other threads with default-sized stacks?

Might be possible, I don't know.  For example, does any of the code
make any hidden assumptions that the Lisp thread is the main thread?

And in any case, if threads are created for each invocation, and never
die as long as Emacs runs, then sooner or later Emacs will run out of
address space and/or handles (I see on that single system where I can
reproduce the problem that each such thread consumes 2 handles, and I
don't see it exit).

So it sounds like trying to find and fix the reason(s) for this rare
behavior, or find a workaround (other than not using the API) is a
better alternative, at least at this point.