if {0} { Hello !! Although I read the wiki/doc about Tcl_Obj Incr/DecrRefCount , there are issues I still don't understand, notably when should I delete Tcl_Obj when there RefCount changed. I comment the code below as I understand how ref counts are managed by public Tcl routines. My problem with this code is that the memory keeps increading as the routine is called several times (as a help for understanding the code, objv[1] contains a list made of pairs : name1 seq1 mane2 seq2 ... all seqX have the same length) Tcl_Obj **Lseq, *Res, *LSG, *LGS, *ONom, *Og, *Os; if (Tcl_ListObjGetElements(interp,objv[1],&nseq,&Lseq) != TCL_OK) { /* Lseq has refCount + 1 */ /* Lseq can't be deleted , as said in the man page :"The memory pointed to is managed by Tcl and should not be freed or written to by the caller" */ return TCL_ERROR; } LSG = Tcl_NewListObj(0,NULL); LGS = Tcl_NewListObj(0,NULL); /* catch the sequence length */ sq0 = Tcl_GetByteArrayFromObj(Lseq[1],&slen); seq = (char *)ckalloc((slen+1) * sizeof(char)); /* Treat each pair of name/seq */ for (i=0;i