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 consumption increasing running hammerdbcli on Windows #765

Closed
sm-shaw opened this issue Nov 4, 2024 Discussed in #763 · 1 comment · Fixed by #766
Closed

Memory consumption increasing running hammerdbcli on Windows #765

sm-shaw opened this issue Nov 4, 2024 Discussed in #763 · 1 comment · Fixed by #766
Assignees
Labels
bug Something isn't working

Comments

@sm-shaw
Copy link
Contributor

sm-shaw commented Nov 4, 2024

Discussed in #763

Originally posted by filiptanic98 October 30, 2024
Hello all,

I noticed that memory consumption is constantly increasing when running HammerDB TPCC benchmarks through hammerdbcli and using .tcl scripts.
My infrastructure consists of containers created inside of Azure VMs. From those containers I am targeting my MS SQL Server instance.
To run hammerdb from containers I use .tcl scripts and hammerdbcli.
I noticed that sometimes when I run TPCC I was getting out of memory errors in containers.
After that I investigated and found out it was correlated with the benchmark duration.
I continued my investigation and found out that memory usage of tclsh86t process is constantly increasing when benchmark is running.
I also tried reproducing this from outside container on my local machine and behavior is same.
I tried with running HammerDB from GUI (which runs wish86t.exe process) and there is no memory usage increase.
Image1 - reproduced issue on my local machine:
image

Image2 - shows constant memory increase for the container running inside kubectl environment:
image

Did someone encounter similar issues with hammerdbcli?

@sm-shaw sm-shaw self-assigned this Nov 4, 2024
@sm-shaw sm-shaw added the bug Something isn't working label Nov 4, 2024
@sm-shaw
Copy link
Contributor Author

sm-shaw commented Nov 5, 2024

I have done an initial investigation and the effect can be observed on all databases on both Linux and Windows with both GUI and CLI.

The cause is from the xtprof time profiling package, and therefore the increase in memory is to be expected.

Every time a stored procedure is called for every virtual user, the timing data is recorded in a virtual user independent array. When each virtual user is finished, the data is shared with the monitor virtual user that collects all the timing data and reports it.

The gathered data is deleted for each virtual user after sharing it, however some of the monitor virtual user dicts and thread shared variables are only reset on the next run. Therefore, we can free some memory by freeing these thread shared variables and dicts after the timings are reported, rather than at the start of a run.

However, the main memory increase during a run can be explained by HammerDB gathering the timings for every VU for every function call and storing it locally in an array, which is a relatively large amount of data.

Note that if the xtprof timer is not loaded (in the GUI or CLI) then timings are not gathered and there is no memory increase.

@sm-shaw sm-shaw linked a pull request Nov 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant