i noticed a strange thing with a current project:
I use the Mk4tcl binding from Tclkit 8.4.5 on Windows 2000, now i parse a textfile containing strings and an integer associated with the string.
Something like:
10 AB_0057357 11 CF_8463800 11 CD_3648208 (about 270.000 records, 10 MB)
Now i setup a simple in memory Metakit dataset with:
mk:file open db datafile.mk
mk::view layout db.map {key:S id:I}I load the small 10MB Datafile into memory with set fid [open $file] set lines [lrange [split [read $fid] \n] 0 end-1]
Now i scan the data with a proc that is called from an [after 1] that reschedules itself with [after 1], it takes the current line number as argument, so i have something like:
proc process_some_lines {db line} {
global lines ;# in my actual script this is "my instvar data" using XOTcl
set iteration 0
while {$iteration < 50} {
if {[llength $lines] <= $line} {set ::done 1; return}
set currentLine [lindex $lines $line]
scan $line "%d %s" id key
mk::row append $db.map key $key id $id
incr line
incr iteration
}
after 1 [list process_some_lines $db $line]
}
The data is commited, when ::done is set to 1, via a vwait and a mk::file commit.
The strange thing i see is the memory hunger of this construction.
It eats memory like nothing, the shell grows to 300 MB with size jumps in the range of up to 50MB in both directions, but the datafile produced on disk is only 4MB in size.
If i process the data line by line i don't get this huge memory hunger. I'm quite sure that i don't copy anything.
I'm not sure if Metakit or XOTcl or the normal Tcl is the thing that creates trouble here. With tclkit 8.4.1 it crashes actually with a can't realloc 1622777730 bytes dialog box popping up.
I may recheck with a smaller Skript, as my current problem is deeply inside a multi thousand line XOTcl program and depends on lots of infrastrukture (that does not leak as i checked by using a different approach).
Any idea what this could be?
Michael
_____________________________________________ Metakit mailing list - [EMAIL PROTECTED] http://www.equi4.com/mailman/listinfo/metakit
