Skip to content

MaxMemory check succeeds against an instance with Max Memory value greater than (Recommended+379) #836

Description

@a4ic6n

Bug Report

General Troubleshooting steps

  • Verified running the latest release of dbachecks?

Does (Find-Module dbachecks).Version match (Get-Module dbachecks).Version.ToString()

image

  • Verified errors are not related to permissions?
  • Can duplicate in new/clean PowerShell session (clean = powershell -NoProfile)?

Version Information

  • Operating System (Name|Version): Windows 10|1803
  • PowerShell Version: 5.1.17134.858
  • dbachecks Version: 2.0.9
  • dbatools Version: 1.0.140
  • PSFramework Version: 1.1.59
  • Pester Version: 4.10.1
  • SQL Server (Edition|Version): Standard Edition (64-bit)|14.0.3294.2

Steps to Reproduce

  • Run Invoke-DbcCheck -Checks MaxMemory against an SQL Server instance with default max memory settings (2147483647).

  • Attach any screenshots (if possible/allowed)

  • Attach output from PowerShell console (if possible/allowed)

PS C:\Users\aic1> Test-DbaMaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
WARNING: [17:10:52][Test-DbaMaxMemory] Couldn't get accurate SQL Server instance count on SIRBNM-TEST23\SIRSQL6. Defaulting to 1. | No services found in relevant namespaces on SIRBNM-TEST23.
Please note that this function is available from SQL 2005 up.


ComputerName     : SIRBNM-TEST23
InstanceName     : SIRSQL6
SqlInstance      : SIRBNM-TEST23\SIRSQL6
InstanceCount    : 1
Total            : 16377
MaxValue         : 2147483647
RecommendedValue : 11257
PS C:\Users\aic1> Invoke-DbcCheck -Checks MaxMemory -SqlInstance SIRBNM-TEST23\SIRSQL6 -SqlCredential (Get-Credential sa)
Pester v4.10.1
Executing all tests in 'C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1' with Tags MaxMemory

Executing script C:\Program Files\WindowsPowerShell\Modules\dbachecks\2.0.9\checks\Instance.Tests.ps1

  Describing Max Memory

    Context Testing Max Memory on SIRBNM-TEST23\SIRSQL6
      [+] Max Memory setting should be correct on SIRBNM-TEST23\SIRSQL6 380ms
Tests completed in 1.05s
Tests Passed: 1, Failed: 0, Skipped: 0, Pending: 0, Inconclusive: 0

Description of Bug

MaxMemory check succeeds against an SQL Server instance with Max Memory value greater than (Recommended+379), when it shouldn't.

Workaround

Replace
$psitem.SqlMaxMB | Should -BeLessThan ($psitem.RecommendedMB + 379) -Because 'You do not want to exhaust server memory'
with
$psitem.MaxValue | Should -BeLessThan ($psitem.RecommendedValue + 379) -Because 'You do not want to exhaust server memory'
in <ModulePath>\dbachecks\<Version>\checks\Instance.Tests.ps1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions