-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suspected memory leak #1549
Comments
Hi @georgekcchung, I suspect you are hitting the combination of golang's GC not being able to keep with the garbage generation and one of the many things that k6 doesn't do to make it less likely that this will happen, as well as having a script that generates a lot of objects :).
|
@mstoykov , thanks for your swift reply.
My testing machine has 12G RAM. I didn't witness the death of the progress but I saw "killed" message in command
Thanks. |
@georgekcchung any update on this? Can we close this or do you still think there is a memory leak? |
I do think there is a memory leak here. Consider the following;
This is a very simple test that simply downloads data from a websocket. I've followed the advice of @mstoykov and it didn't seem to yield any results. For instance: The first spike is with no changes, the second is with My machine has 32gb of RAM, so it taking up that much with 300VU's and never GC'ing makes me really think there is a memory Leak. It sucks that I'm having this problem. It's such a small road block yet might be expensive to overcome! Any Ideas? Thanks in advance! |
Hi @luckybroman5, I did try to reproduce this using this script and the server.go implementation. With This was using the v0.28.0. It should be noted that pre v0.27.0 there were a lot of issues in the ws package and it is far from "good" even now but at least memory leaking seems to not be one of the issues anymore. Running with v0.26.2 it does seem to be leaking or at least to be using more memory but not with the speed you are showing - I got to 600mb after 4 minutes with Please provide more information(after updating to v0.28.0 if you are not using it) like:
it will be best if you can make it break reliably and share the script and a server implementation as I did. I can help you with both but I will need more information :). p.s. I removed to logging as it was really noisy and in my experience it increased the memory usage as it also increased the request making speed :) |
@mstoykov Sure. There is about 300 messages/sec coming in over the websocket, and the message size is relatively small: Here are the flags I'm running my script with: I'm also running k6 via docker. Hopefully that helps. I will also try and remove the logging. |
can you try without the |
@mstoykov that seems to have done it! Unfortunately though, not being able to use influxdb is not ideal for my tests. Is there any thing I can do to help? |
Run with
|
@luckybroman5 did any of this help you ? |
I am closing this as the original user hasn't responded in quite some time and the problem seems to have been that they are using too much memory not that k6 has a memory leak ... |
Environment
Expected Behavior
The k6 process's memory usage should keep constant
Actual Behavior
The k6 memory usage keeps increasing until it is killed by OS due to OOM
Steps to Reproduce the Problem
command line to run k6: ./bin/k6 run -u 100 -d 48h --insecure-skip-tls-verify --discard-response-bodies -q --no-connection-reuse --no-vu-connection-reuse --no-color run-https.js
content of run-https.js
The text was updated successfully, but these errors were encountered: