k6 icon indicating copy to clipboard operation
k6 copied to clipboard

Memory leak of a simple test

Open Zywertos opened this issue 1 year ago • 0 comments

Brief summary

K6 is leaking memory even when running a test that doesn't perform any actual actions. I ran a test with 1000 requests per second and noticed that my RAM usage slowly increased by about 1MB every few seconds. To amplify this behavior, I ramped it up to 100k requests per second. As a result, K6's memory usage went from around 500MB to 2GB after 17 minutes of running the test.

I want to run tests on my app, and I need them to last around 24 hours. The tests are simple, but after a few hours, K6 starts using up 12GB of RAM, which ends up causing a crash...

Am I missing something? I don’t think this is the intended behavior.

k6 version

k6.exe v0.53.0 (commit/f82a27da8f, go1.22.6, windows/amd64)

OS

Windows 11

Docker version and image (if applicable)

No response

Steps to reproduce the problem

Just run this test for some time:

`export const options = { "scenarios": { "contacts": { "executor": "constant-arrival-rate",

        "duration": "24h",

        "rate": 100000,
        "timeUnit": "1s",

        "preAllocatedVUs": 1000
    }
}

}

export default async function () { }`

Expected behaviour

RAM should stabilize after a while and stop allocating more.

Actual behaviour

There's RAM leak.

Zywertos avatar Sep 16 '24 10:09 Zywertos