|
2009-05-29
| ||
| 19:06 | • Closed ticket [2797879fff]: Better memory management plus 6 other changes artifact: 78dc4d7681 user: patthoyts | |
| 19:05 | • Ticket [2797879fff]: 4 changes artifact: e473625fb1 user: patthoyts | |
|
2009-05-28
| ||
| 19:58 | • Pending ticket [2797879fff]. artifact: 3eb42d26d1 user: dkf | |
| 12:14 | • New ticket [2797879fff]. artifact: bf70993adb user: zbigniew_b | |
Better memory management
Closed / Invalid2797879fffffffffffffffffffffffffffffffffCreated 18 years agoUpdated 18 years ago
Descriptionplain2009-05-28 12:14:47
I made a test using Pat's script mkzip.tcl (taken from wiki-page "creating zip file archives from tcl with zlib") - and I wanted to check it out in a bit more difficult conditions, than usual.
On the machine equipped with 64 MB RAM (Linux) I've turned off swap space to limit the available memory size. Then I tried to pack into one ZIP archive 4 files, of sizes (around): 33, 51, 55, 61 MB. The machine had about 44 MB free ("htop" utility's report), so - as you can see - 3 of the files had larger size than available memory (with no swapping possibility). Unfortunately: mkzip.tcl rather quickly gave up, answering "Can't allocate *some_size* bytes". But the zip utility present in the system was able to pack that files into one large archive.
Of course, having the new package will make archives handling now much easier. But perhaps could be possible to make its algorithms even better, to make it (if it's possible at all) quite independent from the available memory size - as it was in case of zip utility?
dkfplain2009-05-28 19:58:45
The issue is that the mkzip.tcl script is written to assume that the data fits in memory. The base zlib code does not make this assumption — it provides two[*] streaming interfaces as well as "all in memory" interfaces — so I'm at a loss as to how to deal with this problem other than to suggest that the system zip utility is more thoughtfully written... (With apologies to Pat, of course.) [*] One is command/object oriented, and the other is through pushing a special channel transform.
patthoytsplain2009-05-29 19:05:53
This would be why its a demo code on the wiki and not already rolled into the tclvfs project. It doesn't use the streaming api but just [zip deflate $source]. Eventually we should have a better version that makes the vfsZip package read-write for zip archives and would use the streaming interface.
patthoytsplain2009-05-29 19:06:01
allow_comments - 1
Log in (anonymous is fine) to add a comment.