Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-06-08
09:13 • Closed ticket [1732364fff]: TclOO leaks on create destroy loop plus 6 other ... artifact: dd14e99879 user: dkf
06:42 • Open ticket [1732364fff]. artifact: 7d0190c820 user: mpc_janssen
06:41 • Ticket [1732364fff]: 4 changes artifact: ac0e58668a user: mpc_janssen
06:30 • Closed ticket [1732364fff]. artifact: 3426bbf540 user: dkf
06:28 • Open ticket [1732364fff]. artifact: 690402d373 user: mpc_janssen
06:16 • Closed ticket [1732364fff]. artifact: ee74b38504 user: dkf
05:04 • Ticket [1732364fff]: 5 changes artifact: 80c5549e3e user: dkf
2007-06-07
03:48 • Ticket [1732364fff]: 4 changes artifact: 27f1f69422 user: mpc_janssen
03:45 • Ticket [1732364fff]: 4 changes artifact: f075b44686 user: mpc_janssen
03:40 • Ticket [1732364fff]: 4 changes artifact: 020f606f1b user: mpc_janssen
03:39 • Ticket [1732364fff]: 1 change artifact: 670ae63b1c user: mpc_janssen
2007-06-06
20:39 • New ticket [1732364fff]. artifact: 0264d89988 user: mpc_janssen

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.