Subject: bug#79023: 30.1.90; Suspicion of memory leak on internal_redisplay (MacOS)

From: Eli Zaretskii <[email-masked]>
Date: Mon, 11 Aug 2025 16:36:27 +0300

> From: Przemysław Alexander Kamiński
>  <[email-masked]>
> Cc: [email-masked]
> Date: Mon, 11 Aug 2025 14:09:21 +0200
> 
> 
> I was doing some allocation debugging (it's a build with render block &
> release fixes). It seems I found the problem (30 minute non -Q instance).
> 
>  654.03 MB      69.0%	44835	 	macfont_list
>  654.03 MB      69.0%	44835	 	 font_list_entities
>  654.03 MB      69.0%	44835	 	  font_find_for_lface
>  489.50 MB      51.6%	44541	 	   fontset_find_font
>  489.50 MB      51.6%	44541	 	    fontset_font
>  489.50 MB      51.6%	44541	 	     face_for_char
>  305.78 MB      32.2%	5658	 	      FACE_FOR_CHAR
>  179.89 MB      18.9%	172	 	      FACE_FOR_CHAR
>  164.53 MB      17.3%	294	 	   font_load_for_lface
> 
> I have approx. 500 different fonts which I suppose would explain 10KB
> per allocation. I will check if I can release those cleanly.

This is supposed to cons a list (a Lisp_Object) of relevant fonts,
which is then reclaimed by GC after face_for_char returns (because
there are no references to it).  Is that not what happens on macOS?