Skip to content
Tcl Source Code Artifact [1ee1de9552]
Login

Artifact [1ee1de9552]

Artifact 1ee1de9552b7189dfdb4157ff6c4268eecc560ab:

Ticket change [1ee1de9552] - New ticket [781746ffffffffff|781746ffff] <i>Memory leak with arrays whose elements are lists</i>. by jbeltz on 2003-08-01 21:05:59.
D 2003-08-01T21:05:59
J assignee hobbs
J cmimetype text/plain
J comment This\sis\smy\sfirst\ssummitted\sbug\sreport\sso\splease\sforgive\s\nany\snewbie\stype\smistakes.\n\nOS:\s\sHP-UX\s11.0\nProblem\sbehavior:\nWe\snoticed\sa\smemory\sproblem\swith\sa\stcl\sscript\swhich\s\nwhich\soccurs\swhen\saccessing\sa\slist\sfrom\san\sarray.\s\sIt\sis\s\na\svery\sbizarre\sproblem\sand\shave\snarrowed\sit\sdown\sto\sa\s\npretty\ssimple\sscript\s(See\sattached\sscript\smemarrlist).\n\nIt\sseems\slike\swhenever\syou\suse\sthe\slist\sfrom\sthe\sarray\s\ndirectly\sit\scauses\smemory\sto\sgrow.\s\sHowever\sif\syou\smake\s\na\scopy\sof\sit\sfirst\susing\s[concat\s$a($elem)]\sthen\sit\sis\sfine?\n\nRun\stop\s-s1\sin\sone\swindow,\sand\srun\sthe\sscript\sin\s\nanother.\s\sThe\sscript\swaits\sin\sthree\splaces.\n\nThe\sfirst\sis\safter\severything\shas\sbeen\sinitialize.\s\sTop\s\nshould\ssay\sthe\ssize\sof\sthe\sprogram\sis\sabout\s9M.\n\nThe\ssecond\sis\safter\srunning\sthrough\sthe\sfirst\sloop.\s\sThis\s\nloop\smakes\sthe\scopy\sof\sthe\slist\sfrom\sthe\sarray\sthen\suses\s\nthe\scopy\sin\sthe\sfollowing\scommand.\nset\ssize\s[[length\s$recordList]\nThis\sdoesn't\scause\sthe\sprogram\sto\sgrow\sso\stop\sshould\s\nstill\ssay\sabout\s9M.\n\nThe\sthird\swait\syou\smay\snever\sget\sto\sbefore\srunning\sout\s\nof\smemory.\s\sThis\sloop\sdoes\sone\sof\stwo\sthings\sboth\sof\s\nwhich\scause\sthe\sprogram\sto\srun\sout\sof\smemory.\n\n\s\s\s\sif\s{\s1\s}\s{\n\s\s\s\s\s\s\s\sset\srecordLine\s$a($index)\n\s\s\s\s\s\s\s\sset\ssize\s[llength\s$recordLine]\n\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\sset\ssize\s[llength\s$a($index)]\n\s\s\s\s}\n\n\n\n\s
J foundin obsolete:\s8.4.0
J priority 5\sMedium
J resolution None
J status Open
J submitter jbeltz
J subsystem 42.\sMemory\sPreservation
J title Memory\sleak\swith\sarrays\swhose\selements\sare\slists
J type Bug
K 781746ffffffffffffffffffffffffffffffffff
U jbeltz
Z 7f53436ca4f0bbc761e312dfa9727cbd