Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[karate 1.4.1] OOM when load testing with mock for several minutes #2530

Closed
brown-kaew opened this issue Mar 11, 2024 · 5 comments
Closed

[karate 1.4.1] OOM when load testing with mock for several minutes #2530

brown-kaew opened this issue Mar 11, 2024 · 5 comments
Assignees
Milestone

Comments

@brown-kaew
Copy link
Contributor

Hello, according to : #2448
I have tried reproduce OOM on 1.4.1 and it still occurs

Versions:
java 11
karate 1.4.1

Repo to reproduce: https://github.com/brown-kaew/try-karate-mock/tree/test-leak-1.4.1

Steps:
Start mock ./local_startup.sh
Start load test ./load_test.sh

VisualVm: https://github.com/brown-kaew/try-karate-mock/blob/test-leak-1.4.1/logs/1.4.1/Screenshot%202567-03-11%20at%2014.47.24.png
OOM log: https://github.com/brown-kaew/try-karate-mock/blob/test-leak-1.4.1/logs/1.4.1/nohup.log

@ptrthomas
Copy link
Member

@brown-kaew I'm considering this low priority because it never has been reported by anyone else. also 1.5.0.RC3 is what we consider the latest available version. thanks a lot for the research, it would be great if you can also suggest a fix and perhaps contribute a PR

brown-kaew added a commit to brown-kaew/karate that referenced this issue Mar 17, 2024
The StringBuilder object inside StringLogAppender has never be called collect() to de-refer all the string objects. it leads memory leak on long running mock server
@brown-kaew
Copy link
Contributor Author

@ptrthomas It is the first PR I have created, if there is anything wrong please kindly advise.

brown-kaew added a commit to brown-kaew/karate that referenced this issue Mar 18, 2024
The StringBuilder object inside StringLogAppender has never be called collect() to de-refer all the string objects. it leads memory leak on long running mock server
brown-kaew added a commit to brown-kaew/karate that referenced this issue Mar 18, 2024
ptrthomas added a commit that referenced this issue Mar 18, 2024
…eak-for-mock

#2530 Fix StringLogAppender leaks for MockHandler
@ptrthomas ptrthomas added this to the 1.5.0 milestone Mar 18, 2024
@ptrthomas
Copy link
Member

@brown-kaew much appreciated ! the PR and fix looks good. thanks for your work on this.

@brown-kaew
Copy link
Contributor Author

@ptrthomas Thank you.

@brown-kaew brown-kaew changed the title [karate 1.4.1] OOM when load testing for several minutes [karate 1.4.1] OOM when load testing with mock for several minutes Mar 19, 2024
marcinmilewski93 pushed a commit to marcinmilewski93/karate that referenced this issue Jul 15, 2024
The StringBuilder object inside StringLogAppender has never be called collect() to de-refer all the string objects. it leads memory leak on long running mock server
marcinmilewski93 pushed a commit to marcinmilewski93/karate that referenced this issue Jul 15, 2024
The StringBuilder object inside StringLogAppender has never be called collect() to de-refer all the string objects. it leads memory leak on long running mock server
@ptrthomas
Copy link
Member

1.5.0 released

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants