Redirection and memory leak?

May 20, 2008
10,675
83
Syracuse, NY, USA
Win10/64: v23 and v24 are very different in this respect (see below). If you don't have PSTAT, you can add the private working set to TaskMgr and watch it there. Here's v23.
Code:
v:\> *pstat /f W
Working Set:    25344 KB

v:\> do i=1 to 100000 ( echo foo > NUL )

v:\> *pstat /f W
Working Set:    25456 KB

And here's v24,
Code:
v:\> *pstat /f W
Working Set:    25508 KB

v:\> do i=1 to 100000 ( echo foo > NUL )

v:\> *pstat /f W
Working Set:    782324 KB

Repeating that experiment, I've had v24's working set over 3GB.
 
May 20, 2008
10,675
83
Syracuse, NY, USA
Redirection does not allocate memory.
It doesn't happen if I replace "echo foo > NUL" with (my do-nothing plugin) NOOP. Does redirection open (and not close) handles? In any case the working set grows a lot. On Win7/32 there are side effects which I haven't seen (yet) on Win10/64 ... like commands stop working! For example (working set up to about 300000K).
Code:
v:\> *pstat /f W
Working Set:    19344 KB

v:\> which textpad
textpad is an external : L:\TextPad5\TextPad.exe

v:\> do i=1 to 100000 (echo foo > nul)

v:\> *pstat /f W
v:\> which textpad
v:\>
 
Last edited: