Skip to content

High memory usage when compiling ent-generated files. #3814

@udit9576

Description

@udit9576

Current Behavior 😯

When Ent generates models/entities for the schema, it creates them in a single directory and the go compiler compiles the same in a single process. When the ent-generated files are being compiled, it takes a lot of memory and time.

Having defined schema for around 300 tables, no. of files generated is proportionally large and the go compiler takes a lot of time and memory to compile, even causing the server to go out of memory sometimes.

Your Environment 🌎

Current Server Configuration: 8Gib RAM

Tech Version
Go 1.19
Ent 0.12.3
Database MySQL
Driver https://github.com/go-sql-driver/mysql

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions