Skip to content
Tcl Source Code View Ticket
Login

View Ticket

TclOO leaks on create destroy loop

Closed / Fixed1732364fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-06-06 20:39:05
The following code leaks memory on TclOO 0.1 Tcl 8.5 HEAD:

package require TclOO
namespace import ::oo::*
while 1 {  
  class create A
  A create a
  a destroy
  A destroy
}
mpc_janssen Ticket [1732364fff]: 1 change [History diff]2007-06-07 03:39:20
mpc_janssenplain2007-06-07 03:40:39
Logged In: YES 
user_id=1463011
Originator: YES

Forgot to mention OS: Windows XP SP2
mpc_janssenplain2007-06-07 03:45:50
Logged In: YES 
user_id=1463011
Originator: YES

Forgot to mention OS: Windows XP SP2
mpc_janssenplain2007-06-07 03:48:04
Logged In: YES 
user_id=1463011
Originator: YES

Note that the following doesn't leak, so the leak seems to occur when destroying classes:

package require TclOO
namespace import ::oo::*
class create A
while 1 { 
A create a
a destroy
}
dkfplain2007-06-08 05:04:19
Logged In: YES 
user_id=79902
Originator: NO

I've plugged one hole, but I'm pretty sure I'm missing one too.
dkfplain2007-06-08 06:16:42
Logged In: YES 
user_id=79902
Originator: NO

Problem seems fixed.
mpc_janssenplain2007-06-08 06:28:50
Logged In: YES 
user_id=1463011
Originator: YES

On my system this leak has been fixed with the latest CVS version
dkf Closed ticket [1732364fff]. [History diff]2007-06-08 06:30:55
mpc_janssenplain2007-06-08 06:41:52
Logged In: YES 
user_id=1463011
Originator: YES

Unfortunately, I was testing with the instance create/destroy loop (which didn't leak). Leak still exists.
mpc_janssen Open ticket [1732364fff]. [History diff]2007-06-08 06:42:11
dkfplain2007-06-08 09:13:22
Logged In: YES 
user_id=79902
Originator: NO

Gotcha! The class builder was doing the initial splice wrong (it was almost the oldest code in the whole TclOO code, and was obviously in need of a rewrite in the light of a fixed way to create classes...) resulting in leaks in the lists of subclasses/instances of the core objects. Now the example can be run for long periods of time (well, 20 seconds at least) with precisely zero memory consumption growth.
Log in (anonymous is fine) to add a comment.