SeaQL / sea-orm

🐚 An async & dynamic ORM for Rust
https://www.sea-ql.org/SeaORM/
Apache License 2.0
6.56k stars 459 forks source link

Calling multiple deletes_many results in an additional 100MB of memory without decreasing it #2249

Closed TheBlindM closed 3 weeks ago

TheBlindM commented 3 weeks ago

Description

Calling multiple deletes_many results in an additional 100MB of memory without decreasing it. Actually, only a few pieces of data were deleted

Steps to Reproduce

   {
        let db = &CONTEXT.lock().await.db;
        wrap_err!(
        BaseSetupEntity::delete_many()
            .exec(db)
            .await
       )?;

        wrap_err!(
        ConfigEntity::delete_many()
            .exec(db)
            .await
    );
        wrap_err!(
        ConfigEntity::delete_many()
            .exec(db)
            .await
    )?;
        wrap_err!(
        GroupEntity::delete_many()
            .exec(db)
            .await
    )?;
        wrap_err!(
        LoginCredentialsEntity::delete_many()
            .exec(db)
            .await
    )?;
        wrap_err!(
        SessionEntity::delete_many()
            .exec(db)
            .await
    )?;
        wrap_err!(
        SshSessionEntity::delete_many()
            .exec(db)
            .await
    )?;

        wrap_err!(
        EnvVarEntity::delete_many()
            .exec(db)
            .await
    )?;

        wrap_err!(
        ShortcutCmdEntity::delete_many()
            .exec(db)
            .await
    )?;

        wrap_err!(
        ShortcutCmdGroupEntity::delete_many()
            .exec(db)
            .await
    )?;
    }

Versions

sea-orm = { version = "^0.12.12", default-features = false, features = ["sqlx-sqlite", "runtime-tokio-rustls", "macros"] }