Subject: Re: bug#75938: 31.0.50; Temporary file-names overflowing MAX_PATH characters

From: Eli Zaretskii <[email-masked]>
Date: Sat, 01 Feb 2025 10:08:37 +0200

> From: arthur miller <[email-masked]>
> CC: "[email-masked]" <[email-masked]>, "[email-masked]"
> 	<[email-masked]>
> Date: Fri, 31 Jan 2025 20:30:17 +0000
> 
> I just have to restart it. 
> 
> Question is why does it takes all the memory, and why only ~12 gig
>  on 32 gig system. Is there some limit from the OS? I am not aware of
>  such. 

No, it usually means your system doesn't have enough VM.  The fact
that you have 32 GB or physical memory installed is not enough to
judge this case, because on a system running for enough time quite a
bit of that could be used by processes other than Emacs.  The amount
of available VM is determined by the amount of available physical
memory and the amount of available swap ("pagefile" in Windows
parlance).  To see how much available VM you have, run msinfo32 and
look for "Available Virtual Memory".

OTOH, you seem to assume that creating a 1 GB string asks the system
for 1 GB of memory, but that is not so.  I think Emacs asks for more,
in particular because the string could grow, and because Emacs holds
strings in memory in a superset of UTF-8 representation, so each
character could use up to 5 bytes.

> Anyway, regardless of the system, there is some bug, it is perhaps only
>  limited to Windows platform?

Where do you see a bug?  From what you described, Emacs detects that
it will run out of memory and tells you to save your edits and
restart.  This is exactly what should happen in such cases, and not
only on Windows.

In any case, this is a separate issue, unrelated to the stack overflow
when asking to create files with very long names.  AFAIU, that bug is
now fixed on the master branch, right?