In our test environment, we observed what appeared to be a memory leak in the tvnserver.exe file. Upon additional investigation, it was not a memory leak, but rather a leak in handles. You can see this easily in taskmgr.exe, by adding the "Handles" to the column view. I found a couple machines that had 400000+ handles created and ever-increasing until we killed and restarted the server.
In reviewing and editing the code to see if I could identify the issue location, found that in win-event-log/WinEventLog.cpp, in the reportEvent function, an event handle is created, but never closed.
I added a simple CloseHandle(hEventLog); at the end of the reportEvent function before the final close curly brace, recompiled, and tested, and the largest part of the handle leak disappeared, (at least the part that was causing the open handles to exceed 400k). This also appears to have resolved the apparent memory leak.
There still appears to be another much slower handle leak, but I have not been able to identify the root cause yet.
Log in to post a comment.