Skip to content

EFCore 8.0.2 model building comsumes GB of memory and stalls #33266

Closed as duplicate

Description

@HeseRula

Something appears to have changed in the model-building in ef 8.0.2 over 8.0.1

When running the following command

dotnet ef dbcontext optimize -o Repositories\EfCore\CompiledModels -n "Infrastructure.Repositories.EfCore.Contexts"

the process now consumes GB's of memory and pretty much just stalls. The model is very complex and does have cyclic references.
When taking a memory dump, there are GB's of data in

Queue<ValueTuple<Microsoft.EntityFrameworkCore.Metadata.Internal.Property,Microsoft.EntityFrameworkCore.Metadata.Internal.Property,Int32,Int32>>

Same thing happens if we call context.GetService<IDesignTimeModel>().Model in our code.

This has changed since 8.0.1, where it works fine.

Target framework is net8.0
EF.core is version 8.0.2
OS version is win10
IDE is Visual Studio Version 17.9.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions