Redirection and memory leak?

May 20, 2008
11,285
95
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
11,285
95
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:
Similar threads
Thread starter Title Forum Replies Date
A WAD Output redirection to IF block fails with "unbalanced brackets" Support 7
N multiple command alias and redirection Support 0
nikbackm Switch Case and here-document redirection Support 2
M Piping and redirection: CON: Support 5
J WAD Output redirection in tcexit looses data Support 31
J Vers. 18 Here doc redirection broken? Support 4
vefatica Redirection vs. piping? Support 4
I "IF" command in a variable does not expand redirection variable name Support 0
P Fixed TCC 17 describe redirection Support 3
vefatica Speeding up redirection to NUL? Support 32
fpefpe WOW64 Redirection Support 8
D Redirection to clip - env dependency? Support 3
W redirection with pipe don't work Support 10
A Dual redirection Support 3
krischik I/O redirection with start command. Support 6
L redirection to/by perl acts bizarrely Support 9
Charles Dye Strange output, here-doc redirection, TYPE, //UnicodeOutput=Yes Support 6
Daniel Wee Rexx output redirection seems to be broken Support 4
H "Here-String" redirection not working Support 6
cgunhouse Fixed Share Memory Issue Support 5
R WAD Strange output from "memory" command Support 1
vefatica Memory leak (?) in @SMPEEK Support 5
J TCC Out of memory with aliases and functions Support 5
J Memory leak? Support 5

Similar threads