Repository: angular
Issue: JavaScript heap out of memory after using signal inputs
Labels: area: compiler,state: needs more investigation,bug

### Command

build

### Is this a regression?

- [ ] Yes, this behavior used to work in the previous version

### The previous version in which this bug was not present was

_No response_

### Description

Hi,

I have a lib with about 5000 components, all are similar and svg like this:

```
@Component({
  selector: 'svg[si-alarm-icon]',
  standalone: true,
  imports: [],
  template: `
    <svg:path stroke="none" d="M0 0h24v24H0z" fill="none" />
    <svg:path
      d="M16 6.072a8 8 0 1 1 -11.995 7.213l-.005 -.285l.005 -.285a8 8 0 0 1 11.995 -6.643zm-4 2.928a1 1 0 0 0 -1 1v3l.007 .117a1 1 0 0 0 .993 .883h2l.117 -.007a1 1 0 0 0 .883 -.993l-.007 -.117a1 1 0 0 0 -.993 -.883h-1v-2l-.007 -.117a1 1 0 0 0 -.993 -.883z"
    />
    <svg:path
      d="M6.412 3.191a1 1 0 0 1 1.273 1.539l-.097 .08l-2.75 2a1 1 0 0 1 -1.273 -1.54l.097 -.08l2.75 -2z"
    />
    <svg:path
      d="M16.191 3.412a1 1 0 0 1 1.291 -.288l.106 .067l2.75 2a1 1 0 0 1 -1.07 1.685l-.106 -.067l-2.75 -2a1 1 0 0 1 -.22 -1.397z"
    />
  `,
  styles: ``,
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SiAlarmIcon implements OnInit {
  private readonly elementRef = inject(ElementRef);
  private readonly render = inject(Renderer2);

  ngOnInit(): void {
    const svg = this.elementRef.nativeElement;
    this.render.setAttribute(svg, 'xmlns', 'http://www.w3.org/2000/svg');
    this.render.setAttribute(svg, 'width', '24');
    this.render.setAttribute(svg, 'height', '24');
    this.render.setAttribute(svg, 'viewBox', '0 0 24 24');
    this.render.setAttribute(svg, 'fill', 'currentColor');
  }
}
```

The build for this lib is working fine, You can check this GitHub action: https://github.com/khalilou88/semantic-icons/actions/runs/12750337283/job/35534834902


I decided to use signal inputs to allow users to change inputs and I changed the implementation to be like this:

```
@Component({
  selector: 'svg[si-alarm-icon]',
  standalone: true,
  imports: [],
  template: `
    <svg:path stroke="none" d="M0 0h24v24H0z" fill="none" />
    <svg:path
      d="M16 6.072a8 8 0 1 1 -11.995 7.213l-.005 -.285l.005 -.285a8 8 0 0 1 11.995 -6.643zm-4 2.928a1 1 0 0 0 -1 1v3l.007 .117a1 1 0 0 0 .993 .883h2l.117 -.007a1 1 0 0 0 .883 -.993l-.007 -.117a1 1 0 0 0 -.993 -.883h-1v-2l-.007 -.117a1 1 0 0 0 -.993 -.883z"
    />
    <svg:path
      d="M6.412 3.191a1 1 0 0 1 1.273 1.539l-.097 .08l-2.75 2a1 1 0 0 1 -1.273 -1.54l.097 -.08l2.75 -2z"
    />
    <svg:path
      d="M16.191 3.412a1 1 0 0 1 1.291 -.288l.106 .067l2.75 2a1 1 0 0 1 -1.07 1.685l-.106 -.067l-2.75 -2a1 1 0 0 1 -.22 -1.397z"
    />
  `,
  host: {
    '[attr.xmlns]': 'xmlns()',
    '[attr.width]': 'width()',
    '[attr.height]': 'height()',
    '[attr.viewBox]': 'viewBox()',
    '[attr.fill]': 'fill()',
  },
  styles: ``,
  encapsulation: ViewEncapsulation.None,
  changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SiAlarmIcon {
  readonly xmlns = input<string>('http://www.w3.org/2000/svg');

  readonly width = input<string | number>('24');

  readonly height = input<string | number>('24');

  readonly viewBox = input<string>('0 0 24 24');

  readonly fill = input<string>('currentColor');
}
```

Now the build don't work and I have JavaScript heap out of memory.

```
------------------------------------------------------------------------------
Building entry point '@semantic-icons/tabler-icons/outline'
------------------------------------------------------------------------------
- Compiling with Angular sources in Ivy partial compilation mode.
✔ Compiling with Angular sources in Ivy partial compilation mode.
<--- Last few GCs --->
[2192:0x6c895d0]   14[37](https://github.com/khalilou88/semantic-icons/actions/runs/12750704442/job/35536032390#step:5:38)03 ms: Mark-Compact (reduce) 4045.6 (4143.9) -> 4044.8 (4143.7) MB, 3194.72 / 0.00 ms  (average mu = 0.324, current mu = 0.229) allocation failure; GC in old space requested
[2192:0x6c895d0]   146870 ms: Mark-Compact (reduce) 4045.6 (4144.0) -> 4045.2 (4144.2) MB, 3164.06 / 0.00 ms  (average mu = 0.180, current mu = 0.001) allocation failure; GC in old space requested
<--- JS stacktrace --->
FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----
 1: 0xb8d0a3 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 2: 0xf06250 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 3: 0xf06537 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 4: 0x11180d5  [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 5: 0x112ff58 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 6: 0x1106071 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 7: 0x1107205 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 8: 0x10e4856 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
 9: 0x15[40](https://github.com/khalilou88/semantic-icons/actions/runs/12750704442/job/35536032390#step:5:41)831 v8::internal::Runtime_AllocateInOldGeneration(int, unsigned long*, v8::internal::Isolate*) [/opt/hostedtoolcache/node/20.18.1/x64/bin/node]
10: 0x7fd5df4d9ef6
```

More info here: https://github.com/khalilou88/semantic-icons/actions/runs/12750704442/job/35536032390







### Minimal Reproduction

The code is public here: https://github.com/khalilou88/semantic-icons
The brunch that have the problem is `inputs`

The command to run is : `npx nx run tabler-icons:build:production --skip-nx-cache`

You can also run `Build tabler-icons` workflow

I understand if it's out of scope, since I am using NX, just want to share this. 

### Exception or Error

```text

```

### Your Environment

```text
PS D:\Workspace\Projects\semantic-icons> ng version

     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/


Angular CLI: 19.0.7
Node: 20.18.0
Package Manager: npm 10.0.0
OS: win32 x64

Angular: 19.0.6
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1900.7
@angular-devkit/build-angular   19.0.7
@angular-devkit/core            19.0.7
@angular-devkit/schematics      19.0.7
@angular/cli                    19.0.7
@schematics/angular             19.0.7
ng-packagr                      19.0.1
rxjs                            7.8.1
typescript                      5.6.3
zone.js                         0.15.0

PS D:\Workspace\Projects\semantic-icons>
```

### Anything else relevant?

_No response_