Skip to content

Blazor server memory leak occurs after page reloads #49773

@peskovaa

Description

@peskovaa

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

After multiple page reloads, memory is allocated (Heap gen0 - Heap gen1 - Heap gen2). Multiple Blazor control instances stay in memory.

Expected Behavior

The number of Blazor component instances remains the same after a page reload.

Steps To Reproduce

  1. Add a custom Blazor component to the page;

  2. Make a memory snapshot (I used dotMemory);
    BlazorMemoryLeak1

  3. Reload the page several times for memory allocation (Heap gen0 - Heap gen1 - Heap gen2);

  4. Make a memory snapshot.

It has 2 or more instances of your custom component:
BlazorMemoryLeak

Exceptions (if any)

No response

.NET Version

6.0

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions