GC & IRC Server

Rory Mcguire rjmcguire at gm_no_ail.com
Thu Jul 29 00:52:55 PDT 2010


Sean Kelly wrote:

> Rory Mcguire Wrote:
>>
>> Surely all programs that have logging use the GC extensively? I have had
>> a problem with Java and log4j where the entire heap gets used up and its
>> mostly because of unfreed concatenation of strings for logging e.g.:
>> logger.info("connection from"~ socket.remoteAddress());
> 
> I would certainly hope not.  Loggers shouldn't allocate any memory at all,
> except perhaps the occasional buffer increase if they're doing something
> tricky.  I can't believe anyone would create a logger that expected the
> user to perform string concatenation for formatted output.  Then again,
> the Java standard library churns through memory like a Tasmanian Devil on
> an eating binge, so perhaps I shouldn't be terribly surprised.

:D okay, so you're saying avoid string concatenate as much as possible?
Will lots of string concatenates always make the GC go crazy?


More information about the Digitalmars-d mailing list