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

windows_feature msi guard causes memory leak #346

Closed
jonathanmorley opened this issue Mar 1, 2016 · 3 comments
Closed

windows_feature msi guard causes memory leak #346

jonathanmorley opened this issue Mar 1, 2016 · 3 comments

Comments

@jonathanmorley
Copy link

On Windows 2008 R2, running the following powershell causes the TrustedInstaller service to jump from a 1.8Mb baseline to 85Mb used (and doesn't come back down).

Get-WmiObject -Query "SELECT * FROM Win32_OptionalFeature"

Each subsequent use of this command causes a 100 - 300Mb increase in TrustedInstaller's RAM usage

The following command also causes TrustedInstaller to jump to around 85Mb, but it immediately settles back down to a stable 8Mb

dism /online /get-features

These are the commands run by the guard of windows_feature as of #257.

While the new guards are faster, we have seen trustedInstaller services grow to over 1Gb of RAM usage, since the guards are executed every time chef runs.

We need some better way of determining the installation state of a feature.

@jptoto
Copy link

jptoto commented Jun 3, 2016

I can confirm this as well. Only on Server 2008 R2. Windows Server 2012 does not seem to be effected. I run Chef-Client as a service (check in every 10 mins) and it was consistently eating all the RAM across several dozen servers until I disabled it.

@smurawski
Copy link
Contributor

I'd consider a PR that would solve this, but most solutions would require caching the state of installed features which could make resources attempt to converge when they should not.

You could also work around that by putting a guard in place that might check an ohai data (which would require a custom plugin) or shell out to query once in the run and check that in your guard.

While I acknowledge there is still a lot of 2008 R2 out there, it's two (and about to be three) major versions back and more current versions do not seem to have this issue. This is really a bug in the Windows 2008 R2 os.

@tas50
Copy link
Contributor

tas50 commented Nov 23, 2016

The latest release of this cookbook implemented an Ohai plugin for feature caching. This should work around the leak here by only actually obtaining the state on a change vs. on every call.

@tas50 tas50 closed this as completed Nov 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants