[racket] racket http server, major GC: -216 bytes collected

From: Greg Hendershott (greghendershott at gmail.com)
Date: Mon Jan 10 16:53:49 EST 2011

Racket is the first time I've used a system with GC and been able to
see stats for it like this. As a result, maybe this is a dumb question
and the answer is obvious to the rest of you, but:

What does it mean for the GC to collect a negative number of bytes?

My (naive?) mental model is that the GC finds memory that it can
reclaim. I can imagine it collecting zero. But negative?

P.S. I thought "Azul's pauseless garbage collector"
(http://www.artima.com/lejava/articles/azul_pauseless_gc.html, which I
found via http://lambda-the-ultimate.org/node/4165) sounded
interesting. What do folks here who know about GC think about it, and
would this type of approach would be worthwhile for Racket someday?

On Mon, Jan 10, 2011 at 8:53 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sun, 9 Jan 2011 20:19:23 +0100, Stefan Schmiedl wrote:
>> 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.
> There are many reasons that small amounts of memory may accumulate in
> the short run --- especially caches and data structures that
> periodically compact themselves.
> For example, if I start Racket and just run `(collect-garbage)' in the
> REPL, then after a while, I see a cycle of about 20 numbers around
> -1000 and then one number around 15000. That effect seems to be from
> the REPL allocating parameters that create weak boxes that are
> referenced by a chain of records that are periodically compacted into a
> hash table. The negative numbers don't quite balance the positive
> numbers for the first many iterations of the cycle, because there's
> another effect relate to rehashing (that will eventually compact a hash
> table of weak boxes); I expect I'd see a larger positive number if I
> had enough patience to go hundreds of times.
> It's always possible that you're seeing a real leak, but I think it's
> at least as likely that you're just seeing the effects of complex data
> structures in the run-time system.
> Meanwhile, I'm not sure why you're seeing GCs at all when the server is
> idle. The GCs unexpected, right? But if you're using the LRU manager,
> it seems to call `collect-garbage' along with its collection routine.
> _________________________________________________
>  For list-related administrative tasks:
>  http://lists.racket-lang.org/listinfo/users

Posted on the users mailing list.