<i>exec with pipes and fileevents leaks ~2Mb everytime</i> status still Open with 4 other changes
by
.
D 2008-05-08T23:12:07
J icomment Logged\sIn:\sYES\s\nuser_id=496139\nOriginator:\sNO\n\n(Don't\sknow\sif\sthis\swill\sreach\syou,\sSF\sis\sawfully\sunresponsive\sfor\sme)\nI've\ssent\sthis\salso\sto\stcl-core.\n---\nI\sthink\sI\scan\snow\sproduce\sa\sglobal\sanalysis\sof\sthe\spipe-leak\sissue.\n\n(1)\sThis\sis\sa\score\sissue,\sTclx\sis\sa\sred\sherring\shere,\sit\sis\sonly\sone\nof\smany\sways\sof\sexhibiting\sthe\sproblem;\n\n(2)\sA\score-only\sway\sis:\n\n\s#\sthis\sleaks\s2M\sper\srun\sin\sWindows\n\s#\sassuming\s"block.tcl"\scontains\sjust\s"after\s5000"\n\sset\spr\s[open\s"|tclsh\sblock.tcl"\sr];after\s500;fconfigure\s$pr\n-blocking\s0;read\s$pr\s1;close\s$pr\n\n(3)\sThe\scrux\sof\sthe\sproblem\sis\sthe\s(now\spossiby\sobsolete)\nPipeReaderThread\sbeing\sblocked\son\sa\sReadFile\sat\s[close]-time,\simplying\nthe\suse\sof\sthe\sthermonuclear\sTerminateThread,\swhich\sis\sknown\sto\shave\sa\n4k\skernel\sleak\sin\sWindows.\n\n(4)\sBut\sin\stoday's\sWindows\s(XPSP2),\sit\sleaks\s2M,\snot\s4k\s!!!\n\nI\sdon't\sknow\sat\swhich\spoint\sin\stime\sthe\sx500\samplification\sof\sthe\sleak\soccured.\nNotice\sthat\sthe\ssituation\sproducing\sit\sis\srather\sunusual\s(it\sassumes\sa\nlong-running\schild\swhich\swe\sclose\sprematurely\sfrom\sthe\soutput\sside,\nand\sonly\son\s\sWindows\swhere\sthose\stools\s(like\svmstat)\sare\snot\scommon).\n\nNow\sthere\sare\sIMO\stwo\sparallel\spaths\sto\sfollow\ssimultaneously:\n\n\s(P1)\sinvestigate\sto\sunderstand\sthe\slarge\sleak\n\n\s(P2)\s(longer\sterm)\smodernize\sthe\score\sto\suse\swaitable\shandles\n(assuming\sthey\sare\sreally\s!),\sthus\savoiding\sthe\sneed\sof\sancillary\nthreads.\n\nI\swould\slove\sto\shear\scomments\son\sthis.\sI\sfeel\sa\sbit\sshaky\son\sWindows\nto\sundertake\s(P2);\sand\spossibly\sa\sperson\swho\sis\sliterate\sin\sWindows\npatch\shistory\smigh\shome\sin\son\s(P1)\smuch\sfasterthan\sI\swould...\n\nThanks\sin\sadvance,\n\n-Alex\n\n\n
J login ferrieux
J mimetype text/plain
J username ferrieux
K 1958930fffffffffffffffffffffffffffffffff
U ferrieux
Z 91f722aedbeaeaa8cf40bb1a736ee453