[Bug modula2/112923] gm2 runs out of memory

2024-01-05 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112923

--- Comment #2 from Gaius Mulley  ---
Created attachment 56992
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56992=edit
Tiny example code showing the problem

The attached source will compile but consumes vast amounts of ram.

$ time gm2 -g -c  Blowup.mod

takes 43 secs on a amd64 3.6 GHz box and about 6GB ram.  The M2Diagnostic
module will generate resource data and will be called when -fmem-report or
-ftime-report is issued.

[Bug modula2/112923] gm2 runs out of memory

2024-01-05 Thread gaius at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112923

Gaius Mulley  changed:

   What|Removed |Added

   Last reconfirmed||2024-01-05
 Ever confirmed|0   |1
 Status|UNCONFIRMED |ASSIGNED

--- Comment #1 from Gaius Mulley  ---
Indeed - I'm writing a M2Diagnostic module to collect stats about memory and
time consumption - which hopefully will identify the modules consuming too much
resource.

In this particular case it occurs when building an array constant with
characters - I suspect too many temporary constants are being preserved from
the garbage collector.