#1777 Memory problem in Tcl8.3.4?

obsolete: 8.3
closed-invalid
5
2002-02-12
2002-02-12
Anonymous
No

If I compile and run the following program on a 2.4
linux machine (gcc 2.95.3) with tcl8.3.4 which I have
compiled from source, the amount of memory used
increases very rapidly:

#include <stdio.h>
#include <stdlib.h>
#include <tcl.h>

int main() {
Tcl_Interp *interp;
int i;
char task[] = "for {set i 0} {$i < 100} {incr i} {set
a($i) $i}";

for(i = 0; i < 100000; i++) {
interp = Tcl_CreateInterp();
Tcl_Init(interp);
Tcl_Eval(interp, task);
Tcl_Finalize();
Tcl_DeleteInterp(interp);
}

return 0;
}

I hope that this is a satisfactory report,

regards,

Graeme

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-02-12
    • status: open --> pending
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-02-12

    Logged In: YES
    user_id=72656

    Please see the newsgroup comments that note that this is
    not a correct program. If the corrected version still
    exhibits problems, please tell us about how much each
    instance seems to leak.

     
  • miguel sofer

    miguel sofer - 2002-02-12
    • assigned_to: hobbs --> msofer
    • status: pending --> closed-invalid
     
  • miguel sofer

    miguel sofer - 2002-02-12

    Logged In: YES
    user_id=148712

    I'm closing this ticket: Graeme Winter (author of the bug
    report) informed me that the leak is gone if Tcl_Finalize is
    called after deleting the interpreter.