[995] in Coldmud discussion meeting

root meeting help first previous next next in chain last in chain last

[COLD] Memory

daemon@ATHENA.MIT.EDU (Wed May 15 10:23:56 1996 )

Date: Wed, 15 May 1996 14:56:12 +0200
From: silovic@srce.hr (Miroslav Silovic)
To: coldstuff@cold.org

Ok, I got tired from tracking (even with nifty Sun memory checker...)
This snippet with faithfully reproduce memory problem:

;;var i,l; l=[]; for i in [1 .. 1000] l=[@l, ctime()]; for i in [1 .. l.length()] l=l.replace(i," ");

Allocated blocks include stuff that came from ctime() and remnants of
the original list l. My suspect is l.replace() call (because taking the
stuff out of this program makes it stop leaking).

I have also found that the leak in $programmer._decompile() is caused
essentially by this (code is similar to the example above:

  code = obj.decompile(method);
  if (nums) {
      code = code.numbered_text();
  } else {
      for line in [1 .. code.length()]
          code = code.replace(line, "  " + code[line]);

Calling obj.decompile in a loop won't cause any trouble. Lynx, ideas?