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

Home Forums Virtualization VMware Virtualization Why my VM creating big swap file when there is still memory available ?

This topic contains 6 replies, has 4 voices, and was last updated by  Albertwt 8 years, 9 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts

  • Albertwt
    Member
    #147656

    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


    Dumber
    Member
    #200886

    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..


    jasonboche
    Member
    #263412

    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


    Albertwt
    Member
    #317748

    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 ?


    Albertwt
    Member
    #317751

    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 ?


    simondrake79
    Member
    #237704

    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.


    Albertwt
    Member
    #317756

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

    simondrake79;197153 wrote:
    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 !

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.