3 ms·
Actually the more interesting case is your first: some list is appended to indefinitely. The memory isn't leaked in that you can access it, but by the act of no
by bluGill 10y ago
Actually the more interesting case is your first: some list is appended to indefinitely. The memory isn't leaked in that you can access it, but by the act of not cleaning it up your run time performance slowly goes down over time: each list traversal hits elements in the list that presumably never need to be considered again. (if you are not traversing the list from time to time why are you keeping a list?) Several real world bugs have been root caused to some variation of this.