<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0cm;
        margin-right:0cm;
        margin-bottom:0cm;
        margin-left:36.0pt;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;
        mso-fareast-language:EN-GB;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#032DFD;
        font-weight:normal;
        font-style:normal;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:763453948;
        mso-list-type:hybrid;
        mso-list-template-ids:-1037656830 -2144716660 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;
        mso-fareast-font-family:Calibri;
        mso-bidi-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-18.0pt;
        font-family:Wingdings;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US">Hi Seb<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US">Thanks for confirming, that’s good news – I was fearing it may be the core disk utilisation functions which would be a much larger headache!<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal">> Is the XymonDiskPart information used for anything?  I mean, can it be used for anything without writing plug-ins?<o:p></o:p></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US">The [diskpart] section is used in one of our datacentres where they use clustering and the information is used primarily for reporting. So no, it is not used for anything by default.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US">I think the best solution here is for me to add a setting in xymonclient_config.xml allowing you to turn off the diskpart function for specific servers. You can then remove your comment
 and continue to use future updates.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD">Zak <o:p></o:p></span></p>
<p class="MsoNormal"><span style="color:#032DFD;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> SebA [mailto:spah@syntec.co.uk]
<br>
<b>Sent:</b> Friday, 30 March 2018 14:04<br>
<b>To:</b> Beck, Zak <zak.beck@accenture.com><br>
<b>Cc:</b> Xymon Mailing List <xymon@xymon.com><br>
<b>Subject:</b> Re: [External] Memory leak in Windows Virtual Disk service caused by Xymon Windows Powershell client<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Hi Zak,<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Thanks for your swift reply and sorry for my own delay!  It's good to know you have such extensive use of the PS client without this issue.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I think you are probably right.  These issue has only appeared on servers using Windows Cluster Failover, where various iSCSI disks are clustered.<o:p></o:p></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt">For the record, my workaround of disabling the Virtual Disk Service caused no bad effects on the server, but it does prevent diskpart from running.  I set the service back to Manual, and it started as soon as
 I ran diskpart from an elevated Command Prompt.  Exiting diskpart causes the VDS service and proces to stop.<o:p></o:p></p>
</div>
<p class="MsoNormal">When the Virtual Disk Service was set to manual, and started just by me running diskpart.exe, the client output has:<o:p></o:p></p>
<div>
<pre>[diskpart]<o:p></o:p></pre>
<pre>diskpart:::Clustered Unknown<o:p></o:p></pre>
<p class="MsoNormal">When the service is disabled, the output is just an empty section:<o:p></o:p></p>
<pre>[diskpart]<o:p></o:p></pre>
</div>
<div>
<div>
<div>
<div>
<p class="MsoNormal">When VDS is started by me restarting the XymonPSclient service and it being on manual, the output is e.g.:<o:p></o:p></p>
<pre>[diskpart]<o:p></o:p></pre>
<pre>diskpart:Disk 0:278 GB:Not Clustered<o:p></o:p></pre>
<pre>diskpart:Disk 1:1024 MB:Clustered Active<o:p></o:p></pre>
<pre>diskpart:Disk 2:25 GB:Clustered Active<o:p></o:p></pre>
<pre>diskpart:Disk 3:500 GB:Clustered Active<o:p></o:p></pre>
<pre>diskpart:Disk 4:300 GB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 5:1024 MB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 6:500 GB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 7:200 GB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 8:1024 MB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 9:1024 MB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 10:200 GB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 11:200 GB:Clustered Inactive<o:p></o:p></pre>
<pre>diskpart:Disk 12:500 GB:Clustered Active<o:p></o:p></pre>
<pre>diskpart:Disk 13:5120 MB:Clustered Active<o:p></o:p></pre>
<pre>diskpart:Disk 14:500 GB:Clustered Inactive<o:p></o:p></pre>
<p class="MsoNormal" style="margin-bottom:12.0pt">Compared with VDS running because of me running diskpart and running:
<o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">“list disk”</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">For each disk returned, “select disk {n}” and then “detail disk”</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">for each disk (which does not leak memory) vds.exe uses about an extra MB of RAM when running due to the PS client.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">I have also now commented out the line you suggest ('
<span style="color:#032DFD">$script:diskpartData = XymonDiskPart</span> ') and now when I restart the XymonPSclient service with VDS set to Manual it does not get restarted and left running (or restarted at all).  So this looks like a better workaround than
 just disabling the service, but I will need to continue to monitor that.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Is the XymonDiskPart information used for anything?  I mean, can it be used for anything without writing plug-ins?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">We do not have memory leaks in powershell.exe on these servers (although I think I may have seen it on another server), so the issue above is not related to Alessandro's issue.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">Thanks again for your help Zak, and I hope this knowledge is of benefit to you or others too.<o:p></o:p></p>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif">Kind regards,<br>
<br>
SebA</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 14 March 2018 at 09:21, Beck, Zak <<a href="mailto:zak.beck@accenture.com" target="_blank">zak.beck@accenture.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">Hi Seb</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">I’ve got hundreds of VMs running the Powershell client on Windows Server 2008R2, 2012R2 and 2016 and I don’t see this issue. I just checked a couple
 of servers, vds.exe is between 2MB and 20MB and around 21 threads. Same version of vds.exe too.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">I’m wondering if function XymonDiskPart has something to do with it. This only runs on slow scans (every 6 hours-ish by default). This runs ‘diskpart’
 and then</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">“list disk”</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">For each disk returned, “select disk {n}” and then “detail disk”</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">Maybe you could try this from the command prompt on a server with vds stopped and see if it restarts it. You could also try commenting out this line
 (3875, towards the end) in the client and see what happens (insert a # at the beginning of the line):</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">        $script:diskpartData = XymonDiskPart</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">Alternatively, it could be the disk utilisation code which is using Windows API calls in kernel32.dll – FindFirstVolume, FindNextVolume, FindVolumeClose,
 GetVolumeInformation, GetVolumePathNamesForVolumeNameW, GetDiskFreeSpaceEx and GetDriveType. The MSDN documentation for these doesn’t mention the Virtual Disk Service but I guess they could be using it.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD">Zak
</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="color:#032DFD"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> SebA [mailto:<a href="mailto:spah@syntec.co.uk" target="_blank">spah@syntec.co.uk</a>]
<br>
<b>Sent:</b> Tuesday, 13 March 2018 18:14<br>
<b>To:</b> Beck, Zak <<a href="mailto:zak.beck@accenture.com" target="_blank">zak.beck@accenture.com</a>>; Xymon Mailing List <<a href="mailto:xymon@xymon.com" target="_blank">xymon@xymon.com</a>><br>
<b>Subject:</b> [External] Memory leak in Windows Virtual Disk service caused by Xymon Windows Powershell client</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">I have noticed a memory and thread leak in the Windows Virtual Disk service - or vds.exe from the process list.  This service is set to Manual by default and gets started when starting
 the XymonPSClient service on Windows 2008 R2.  It starts off using 32 threads, but grows forever, the virtual memory and physical memory (which starts under 6 MB) used slowly grow too.<br>
<br>
Has anyone noticed this problem and do they have a solution to it?<br>
<br>
On Windows Server 2012, the Virtual Disk service does not get started by Xymon Windows Powershell client, so it's obviously not started directly by the client, but by a request for information.  I looked into known memory leaks for vds.exe and the one I found
 was not applicable to 2008 R2, only 2008 and Vista.  The version of vds.exe we have is later than the version with the fix: 6.1.7601.17514 from 2010.<br>
<br>
The quick workaround is simply to stop the Virtual Disk Service - but as soon as the PSclient has used it, it does not stop properly and terminates unexpectedly, so one needs to set it not to restart on crash, or stop it immediately after starting, or to Disabled. 
 But it would be good to know why it is starting, not stopping, and leaking threads / memory!<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><br clear="all">
<o:p></o:p></p>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><span style="font-size:9.0pt;font-family:"Arial",sans-serif">Kind regards,<br>
<br>
SebA</span><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="100%" align="center">
</div>
<p class="MsoNormal"><span style="font-size:7.5pt;font-family:"Arial",sans-serif;color:gray"><br>
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise confidential information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the e-mail by
 you is prohibited. Where allowed by local law, electronic communications with Accenture and its affiliates, including e-mail and instant messaging (including content), may be scanned by our systems for the purposes of information security and assessment of
 internal compliance with Accenture policy. <br>
______________________________________________________________________________________<br>
<br>
<a href="http://www.accenture.com" target="_blank">www.accenture.com</a></span><o:p></o:p></p>
</div>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>