Skip to content

ARM (aarch64): possible memory leak in feature=luajit #653

@elipp

Description

@elipp

Hey,

I have noticed that when running an Axum/mlua backend on AWS Graviton hardware (t4g.medium to be exact), there's a steady increase in memory usage over time. The growth is proportional to req/s, and can be reproduced like the following:

static COUNTER: AtomicU64 = AtomicU64::new();

async fn lua_endpoint() -> impl IntoResponse {
    let lua = Lua::new();
    let x = COUNTER.fetch_add(1, Ordering::Relaxed);
    let res: mlua::Value = lua.load(format("1+{x}")).eval().unwrap();
   Ok((StatusCode::OK, json!({"res": res}))
}

//axum hello world goes here

When spamming that endpoint with e.g. oha, I'm observing a catastrophic increase in memory usage (with malloc and jemalloc too), which doesn't seem to occur on x86_64.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions