Memory consumption constantly increasing when running hammerdbcli #763
-
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
If you provide some more details on the test environment, then we can try and reproduce, details such as system memory, database version, driver version and also the test being run, the configuration and the number of virtual users etc the more details you can provide the better to reproduce. From the outset when running a workload, you do initially expect the memory consumption to increase as each virtual user is a thread and when it is ramping up it loads a separate interpreter (this is how HammerDB runs completely in parallel) and also loads the ODBC driver, so each time it does this the memory will increase and the more virtual users the more memory it will use - you would expect this to level out after the ramp-up phase is complete, however. Now, one thing you do mention that is of interest here is that you say that the effect is not seen in the GUI only the CLI. So the workload running under both, driver loaded etc is identical except for just one thing, Tclsh creates three additional threads per Virtual User when a thread does any i/o command (puts etc.) - one for stdin, stderr, stdout to the CMD console. Wish does not do this because there is no Windows console attached for GUI apps. So for Windows and CLI only you are going to see 3X the number of threads and therefore will use more memory (but not a huge amount) than the GUI. For further investigation, you can use process explorer and Windows inspection toolkit: https://learn.microsoft.com/en-gb/sysinternals/downloads/process-explorer as per the images below, you can see 3X the threads and more virtual memory (about 100MB) with the CLI: So if the amount of memory is small you may see higher consumption with the CLI, but in both cases it should level out after rampup and not keep increasing. It's not likely to be in the workload itself if it works for the GUI. As noted, what is running is identical in both cases - the CLI is a thin layer over the GUI code. If it is thread count related, the good news is that this was investigated previously and we asked the Tcl core team. Even though it is working correctly by design with an increase in thread counts the design was not optimal, and therefore they advised us that this has now been redesigned in Tcl/Tk 9 https://www.tcl.tk/software/tcltk/9.0.html, so there is not the increase in threads on Windows any more, and we are currently working on porting HammerDB to Tcl/Tk 9. If it does keep increasing the memory throughout the workload after all the virtual users have been loaded, this will need more investigation. |
Beta Was this translation helpful? Give feedback.
-
Hey @sm-shaw , so this is configuration that I am using:
I tried investigating a little bit more throughout the weekend, and what I can confirm - it does not matter what number of virtual users is. I was able to reproduce this locally on SQL VMs, just by using scripts that are in the official HammerDB 4.11 release (scripts located in C:\Program Files\HammerDB-4.11-Original\scripts\tcl\mssqls\tprocc directory). Here are more images: And here you can see memory constantly increasing (this is on 50 virtual users): I guess this large increase at the beginning is due to virtual users loading one by one, but after the virtual users are loaded, I can still see memory increase. Also, I want to note that by using python it is similar situation, but in this case, memory is increasing for python process, and not for tclsh86t: |
Beta Was this translation helpful? Give feedback.
-
Many thanks for the additional information. I will create an issue from this discussion and investigate. |
Beta Was this translation helpful? Give feedback.
-
Issue #765 created |
Beta Was this translation helpful? Give feedback.
Issue #765 created