26 Jan 11:33
stream question / unbound memory?
<karme <at> karme.de>
2012-01-26 10:33:50 GMT
2012-01-26 10:33:50 GMT
Hi,
why does the following example seem to need unbound memory?
sh$ { cat << EOF
#!/bin/sh
#|
GC_PRINT_STATS=1
export GC_PRINT_STATS
exec gosh -- "\$0" "\$@"
|#
(use util.stream)
(define (main args)
(stream-for-each (lambda(x)
(write x)
(newline))
(port->stream (current-input-port) read))
0)
EOF
} > test.scm \
&& chmod +x test.scm \
&& seq 10000000\
|./test.scm 2>&1 > /dev/null \
| grep --line-buffered heapsize |cut -f 2 -d ">"
output should be something like:
heapsize = 262144 bytes
heapsize = 786432 bytes
(Continue reading)
RSS Feed