bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#58631: [Shepherd] Indefinite heap growth (memory leak)


From: Ludovic Courtès
Subject: bug#58631: [Shepherd] Indefinite heap growth (memory leak)
Date: Sat, 22 Oct 2022 22:20:35 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux)

Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> skribis:

> Am Donnerstag, dem 20.10.2022 um 11:29 +0200 schrieb Ludovic Courtès:
>> Logging as performed by ‘%service-file-logger’ is quite GC-intensive
>> (but shouldn’t be leaky!); this bit:
>> 
>>      (let ((prefix (strftime default-logfile-date-format
>>                              (localtime (current-time)))))
>>        (format output "~a~a~%" prefix line)
>>        (loop))
>
>      (let ((prefix (strftime default-logfile-date-format
>                              (localtime (current-time)))))
>        (format output "~a~a~%" prefix line)
>        (loop))
>
> Would it make a difference if you instead wrote
>
>      (let ((prefix (strftime default-logfile-date-format
>                              (localtime (current-time)))))
>        (format output "~a~a~%" prefix line))
>      (loop)
>
> ?  Semantically, they're equivalent (perhaps with a wrapping begin
> needed), but the compiler might fail to see this.

I’m confident the compiler does the right thing, and it’s a tail call so
‘prefix’ doesn’t outlive one loop iteration.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]