[racket] racket http server, major GC: -216 bytes collected
From: Stefan Schmiedl (s at xss.de)
Date: Sun Jan 9 14:19:23 EST 2011 |
|
On Sun, 9 Jan 2011 09:48:12 -0600
Robby Findler <robby at eecs.northwestern.edu> wrote:
> You can call collect-garbage (from a separate thread with a sleep or something).
As reference, lets run racket with 10 sec GC loop waiting for input:
$ racket -W debug -e '(define (loop) (collect-garbage) (sleep 10) (loop)) (thread loop) (read-line)'
GC [minor] at 1570768 bytes; 651544 collected in 1 msec
GC [minor] at 2490256 bytes; 604144 collected in 2 msec
GC [minor] at 4309040 bytes; 1002704 collected in 5 msec
GC [minor] at 7330768 bytes; 1825096 collected in 6 msec
GC [minor] at 9692088 bytes; 1701600 collected in 8 msec
GC [minor] at 14009936 bytes; 3175584 collected in 8 msec
GC [minor] at 17096296 bytes; 3089144 collected in 9 msec
GC [minor] at 22530656 bytes; 3957832 collected in 17 msec
#<thread:loop>
GC [major] at 22007032 bytes; 3129816 collected in 31 msec
GC [major] at 18877216 bytes; 546984 collected in 29 msec
GC [major] at 18330232 bytes; 0 collected in 28 msec
GC [major] at 18330232 bytes; 0 collected in 27 msec
GC [major] at 18330232 bytes; 0 collected in 28 msec
GC [major] at 18330232 bytes; 0 collected in 28 msec
GC [major] at 18330232 bytes; 0 collected in 27 msec
... and so on. No surprises here.
Now I'm starting the web server, and let it sit there without
generating any requests to it:
stefan at g128 racket % racket -W debug -t vacation-loop.rkt
GC [minor] at 1484776 bytes; 644936 collected in 1 msec
GC [minor] at 2219576 bytes; 650160 collected in 1 msec
GC [minor] at 4256104 bytes; 1282136 collected in 4 msec
GC [minor] at 5536496 bytes; 1266784 collected in 4 msec
GC [minor] at 8425248 bytes; 2002960 collected in 6 msec
GC [minor] at 11294320 bytes; 2558752 collected in 7 msec
GC [minor] at 14979616 bytes; 3081168 collected in 10 msec
GC [minor] at 19654248 bytes; 3687032 collected in 11 msec
GC [minor] at 26847384 bytes; 4950544 collected in 26 msec
GC [minor] at 33869392 bytes; 6128176 collected in 21 msec
GC [minor] at 42415792 bytes; 7560040 collected in 25 msec
GC [minor] at 54037080 bytes; 8777192 collected in 40 msec
GC [major] at 69781368 bytes; 15175760 collected in 111 msec
GC [minor] at 84524448 bytes; 19013992 collected in 56 msec
GC [minor] at 99325872 bytes; 20791280 collected in 77 msec
okGC [major] at 108694496 bytes; 60594336 collected in 111 msec
GC [major] at 48137024 bytes; 107072 collected in 87 msec
GC [major] at 48029952 bytes; 113016 collected in 84 msec
GC [major] at 47916936 bytes; -3968 collected in 85 msec
GC [major] at 47920904 bytes; -672 collected in 84 msec
... 17 times repeated, then
GC [major] at 47933000 bytes; 9608 collected in 83 msec
GC [major] at 47923392 bytes; -672 collected in 84 msec
... 30 times repeated, then
GC [major] at 47944224 bytes; 15704 collected in 84 msec
GC [major] at 47928520 bytes; -672 collected in 84 msec
... 4 times repeated, then
GC [major] at 47931880 bytes; -1200 collected in 85 msec
GC [major] at 47933080 bytes; 0 collected in 85 msec
GC [major] at 47933080 bytes; 2936 collected in 85 msec
GC [major] at 47930144 bytes; -1984 collected in 83 msec
GC [major] at 47932128 bytes; -672 collected in 84 msec
... 17 times repeated, then
GC [major] at 47944224 bytes; 12960 collected in 84 msec
GC [major] at 47931264 bytes; -672 collected in 83 msec
... 31 times repeated, then
GC [major] at 47952768 bytes; 15696 collected in 83 msec
GC [major] at 47937072 bytes; -672 collected in 84 msec
... 4 times repeated, then
GC [major] at 47940432 bytes; -3512 collected in 84 msec
GC [major] at 47943944 bytes; 20480 collected in 86 msec
GC [major] at 47923464 bytes; -4552 collected in 83 msec
GC [major] at 47928016 bytes; -672 collected in 83 msec
... 30 times repeated, then
GC [major] at 47948848 bytes; 15624 collected in 83 msec
GC [major] at 47933224 bytes; -672 collected in 83 msec
... and so on and so on and so on.
Well, that was about two hours ago. The reference GC instance is
still idling away at 18330232 bytes, just as before, but the web server
instance has "grown" from 47923392 (first GC of -672 bytes) to 47957512
(first GC of -672 bytes after last "real" GC), that's about 32kB.
Somebody's snacking on my RAM here.
s.