Skip to content
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

Memory leak in LegacyLoopTask, line 54 #11

Open
jwalcorn opened this issue Sep 13, 2024 · 4 comments
Open

Memory leak in LegacyLoopTask, line 54 #11

jwalcorn opened this issue Sep 13, 2024 · 4 comments

Comments

@jwalcorn
Copy link
Member

If you run enough iterations via loopctl, you'll eventually get an OutOfMemoryError. For example:
image

This appears to be because the loopResults list grows without bound, getting a bit larger each iteration. Since we're holding on to this outside the loop, it can't get garbage collected. So line 54 of LegacyLoopTask.java means we eventually run out of memory, if asked to do enough iterations

@jwalcorn
Copy link
Member Author

image

@rtclauss
Copy link
Contributor

I'll take a look at adding JDBC/SQLite support to store the results

@jwalcorn
Copy link
Member Author

OK, cool. Though note this client is just a big Java main(), not running in an app server like Liberty or Tomcat or Quarkus. So that limits things a bit (like connection pooling, etc), even though it is possible to use JDBC/JPA outside of an app server, of course.

@jwalcorn
Copy link
Member Author

I was thinking a bit more about this. I think we should probably just keep track of aggregates, rather than a full recording of the results of each and every iteration (whether in memory or in a database). For example, we could keep a HashMap (or whatever) where the key is the error message (or http return code), and the entry is a counter we could increment each time we encounter a certain error. Then at the end we could show a success percentage, and the top 10 (or whatever) errors that occurred during the run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants