Announcement

Collapse
No announcement yet.

Why my VM creating big swap file when there is still memory available ?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Why my VM creating big swap file when there is still memory available ?

    Hi All,

    My ESXi Specs:

    Dual QuadCore
    Xeon @ 2.33 GHz (2 x 4 Core)
    32 GB DDR2 RAM

    Running about 22 VMs

    Iíve got a strange problem, How come my ESXi got so large swap
    file size ~ approx. 3.5 GB while the amount of total RAM is still not
    100 % used. I've assigned the following specs as in the screenshot (4 vCPU for better performance).

    Can anyone explains why this VM still using swap file?

    FYI: The VMware tools is not installed in this VM.

    See the attached picture below

    Kind Regards,
    AWT
    Attached Files

  • #2
    Re: Why my VM creating big swap file when there is still memory available ?

    more vCPU's might even degrade in performance instead of speeding it up. This has to do with possible high ready times.
    Also, do install the VMware tools. This might solve the memory issues you got or at least partual..
    Marcel
    Technical Consultant
    Netherlands
    http://www.phetios.com
    http://blog.nessus.nl

    MCITP(EA, SA), MCSA/E 2003:Security, CCNA, SNAF, DCUCI, CCSA/E/E+ (R60), VCP4/5, NCDA, NCIE - SAN, NCIE - BR, EMCPE
    "No matter how secure, there is always the human factor."

    "Enjoy life today, tomorrow may never come."
    "If you're going through hell, keep going. ~Winston Churchill"

    Comment


    • #3
      Re: Why my VM creating big swap file when there is still memory available ?

      When a VM is powered on, the VMkernel will create a swap file that is equal to the size of unreserved memory (plus some overhead).

      The default configuration for a VM when it is created is a 0MB memory reservation (by the way, this is a slight departure from previous versions of ESX where half the memory was automatically reserved)

      Therefore, if a VM with 3.5GB of RAM assigned is created and powered on, by default it has a 0MB memory reservation and VMkernel swap of 3.5GB (plus a little overhead) is created on the VMFS (or NFS) volume where the VM resides.

      If you are running out of VMFS (or NFS) disk space and want to shrink that .vswp file, set a memory reservation on the VM, then shut down the VM and power it back on.

      Jas
      VCDX3 #34, VCDX4, VCDX5, VCAP4-DCA #14, VCAP4-DCD #35, VCAP5-DCD, VCPx4, vEXPERTx4, MCSEx3, MCSAx2, MCP, CCAx2, A+
      boche.net - VMware Virtualization Evangelist
      My advice has no warranties. Follow at your own risk.

      Comment


      • #4
        Re: Why my VM creating big swap file when there is still memory available ?

        Thanks to all for the reply,

        CMIIW The reason why this VM got swap file is

        simply because of the ESXi host got the memory over allocated with the other VM, Moreover, all of the VM installed in this host doesn't have VMware tools installed, therefore ESXi cannot allocate the "reserved memory" to this particular VM (no balooning happens).

        When I look at the Guest memory % usage it doesn't make sense to me that this host running slow due to the Swap file created (ESXi swap as well as the Internal VM swap file).

        The VM that i highlighted is the slowest with big swap file created. --> See the screenshot attached.

        shall I use Resource pool in this case to make sure that a certain VM running smoothly ?
        Attached Files

        Comment


        • #5
          Re: Why my VM creating big swap file when there is still memory available ?

          OK, VMware tools is a must before I'm doing Resource Pool-ing.

          I was thinking to put this oracle VM into the Local SATA 7200 rpm but with the SATA-II 3 GBps data rate. While my iSCSI SAN is using SAS 15.000 rpm.

          I can now conclude that all VM without using VMware tools is consuming the "Allocated memory" (whatever I set in the first place) so anything above the 32 GB physical memory will be written to the ESXi swap file ?

          Comment


          • #6
            Re: Why my VM creating big swap file when there is still memory available ?

            Firstly, VMware Tools is absolutely essential. Not only does it provide important monitoring and administrative tools but it also improves performance for CPU and Memory.

            Secondly, as previously stated the swap file is created when the VM is created and is subject to the amount of memory allocated (and reserved). The VM will use physical RAM available to it (from the host or the resource pool). At times of resource constraints the VM will then use the swap file (sounds like Windows!)

            As a general rule (in ESX context) any paging is bad so you'll need to keep an eye on it in vCenter/Virtual Center by checking the Resource Allocation tab and keeping an eye on the Balloned and Swapped figures (i use vCenter so i dont know what they are in Virtual Center, if they even exist)

            This is my understanding.

            Comment


            • #7
              Re: Why my VM creating big swap file when there is still memory available ?

              Originally posted by simondrake79 View Post
              Firstly, VMware Tools is absolutely essential. Not only does it provide important monitoring and administrative tools but it also improves performance for CPU and Memory.

              Secondly, as previously stated the swap file is created when the VM is created and is subject to the amount of memory allocated (and reserved). The VM will use physical RAM available to it (from the host or the resource pool). At times of resource constraints the VM will then use the swap file (sounds like Windows!)

              As a general rule (in ESX context) any paging is bad so you'll need to keep an eye on it in vCenter/Virtual Center by checking the Resource Allocation tab and keeping an eye on the Balloned and Swapped figures (i use vCenter so i dont know what they are in Virtual Center, if they even exist)

              This is my understanding.
              Great, so in this case VMware tools can help to manage the memory over allocation in this host.

              Thanks for the suggestion mate !

              Comment

              Working...
              X