VMware Communities
_NaN_
Contributor
Contributor

Memory usage and performance

How much memory can I allocate to the guest before swapping starts?

My machine details are as follows:

Host OS is Linux x64

Guest OS is Windows XP x64

My machine in Intel core 2 duo CPU with 4GB RAM

I've modified the config to use 64M for the video display

My VMware preferences are set for no swapping of vm memory

Initially I configured the guest to use 2048MB. When I start this configuration "top" shows the memory usage ramping up as windows boots. "Virtual" memory peaks around 1820MB and "RES" and "SHR" peak around 1.6G and then drop back down to a few hundred Meg. When I try to do anything other that small things in windows the hard drive doesn't stop being accessed and everything runs as slow as walking through treacle.

If I reduce the guest to use 1500MB, when I start windows memory usage ramps up to 1804MB for Virtual and 1.6G for "RES" and 1.6G for "SHR" according to top (on the host). They stay at these values as long as I've got the VM running and tasks done in the guest seem to be much much quicker with less hard drive access going on. i.e. it no longer seems to be swapping all the time.

Why can't I go above 1500MB of guest memory without swapping taking place? I'd really like to use more in the guest, up to 3GB if possible.

TIA

David.

0 Kudos
10 Replies
Peter_vm
Immortal
Immortal

I guess, it would help readers, if you post "uname -a" from your host.

0 Kudos
_NaN_
Contributor
Contributor

For those who are interested, for what it tells you Smiley Wink

>uname -a

Linux namazeze 2.6.18-gentoo-r4 #3 SMP PREEMPT Fri Dec 15 18:24:37 GMT 2006 x86_64 Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz GenuineIntel GNU/Linux

Thanks for looking,

David.

0 Kudos
_NaN_
Contributor
Contributor

I did a number of additional tests over the weekend and can confirm that as long as I allocate no more than 1500MB to the guest it runs well. Anything more than this and VMware seems unable to allocate the memory on the host and the guest runs like a dog. However it sees as much memory as I've allocated. This even happens when I have very little else running on the host and top shows nearly 3500MB of free memory!

Is there a limit to how much memory a single guest VM can use?

TIA

David.

0 Kudos
Bruce_Schmitt
Contributor
Contributor

More of a question than answer. Do you allocate the Guest virtual memory/page swapping as a fixed range or let XP automatically adjust it, and for the VM guys, could this have any performance impact when changing the VM allowed memory?

0 Kudos
Peter_vm
Immortal
Immortal

I tend to allocate as static/fixed. Yes, it can have performance impact; writing to a page file is a disk IO. If you reduce amount of memory allocated for VM, swapping will occure earlier and more often.

But that has probably nothing to do with OP original problem.

0 Kudos
_NaN_
Contributor
Contributor

I let Windows manage its page file.

I don't think this is the problem because if I allocate, say, 2048MB to the guest, when I start it top shows the usage going up to about 1.6G and then falling back down to about 300M. Within windows it reports that is has 2G of physical memory available to it but as soon as I load an application that needs more than a couple of hundred MB the disk starts thrashing and the guest runs as slow as treacle.

For example I ran up Photoshop and then opened a 900MB image. Windows reports what seem like sensible memory usage figures but it is as slow as a dog. If I reduce guest memory to 1500MB then top reports that it is using 1.6G all the time and loading the same image in Photoshop is an order of magnitude quicker, and disk accesses are few after the image has been opened.

David.

0 Kudos
asbarrus
Contributor
Contributor

I am having exactly this same issue. my hardware is:

Dell poweredge 2950 with dual xeon 2mb L2 cache, HT enabled, 3.2 Ghz

Four sata in raid-5 using perc hostraid (a mistake, sorry!)

4 GB RAM

The host is fedora cora 6, semi, but hastily, stripped of extra packages.

Linux **** 2.6.18-1.2868.fc6 #1 SMP Fri Dec 15 17:29:48 EST 2006 x86_64 x86_64 x86_64 GNU/Linux

The three guests are all win 2k3 32-bit. two have 512 mb ram, one has 2048 mb. in my efforts to figure out why the host has 100% disk io time, and all host ram seemed unallocated, all have inserted:

mainMem.useNamedFile = "FALSE"

into each .vmx file. the host is configured to allocate all ram to the vm's and memory trimming is off. snapshots are off, and disks are all defragmented on the host and in the vm. yet, like the op, small operations in the vm with 2gb allocated peg the disks, while res memory allocated sits around 100 meg. i have fought this for a month.

yesterday i set my vm with 2 gb down to 1gb, and the vm's are much happier. res shows 1.1 gb, and stays there (so far). I too would like to allocate more - but would also have preferred not to have the problem over the past month too Smiley Happy Thank you for this post, as my server is now usable. Until now it was a $3000 box with furiously working hard drives that never did anything!

could this have anything to do with 64-bit? does the op have ht enabled also? would that make any difference? does anybody use a vm with more than 1500mb successfully?

0 Kudos
Bruce_Schmitt
Contributor
Contributor

I have a Dell Precision 670, dual 2.8 Ghz with 4 Gb memory.

Host is RHEL3 WS, kernel-smp-2.4.21-40.EL, updates are current, running Workstation 5.5.2 build-29772.

Guest is XP-Pro, SP2, updates are current.

I allocate 2048 memory to 1 Guest, and have reduced the total available from 3256 to 2296 (no significant impact seen as I run only 1 guest at a time, and I do not have mainMem.useNamedFile = "FALSE" defined). I had HT on with Workstation 4, but turned it off after upgrading to 5.5.2. There seemed to be some stability problems if HT is on.

I had some unstable behavior with 5.5.1 when I tried above 2Gb, and had to run less than ~1700. But I have not seen stability problems with 5.5.2. I do get excessive harddrive access at times, however, this may be occurring from specific applications. I have two suspects that aren't necessarily VM related, Symantec and Mathcad. Symantec Protection Agent 5.1 can cause various problems because of how it monitors applications, and Mathsoft's memory access with Mathcad 13 is unstable (I believe it accesses memory directly and not through the XP OS). This seems to be the primary suspect as I get most of my excessive harddrive access while using Mathcad (i.e. perhaps a common issue is applications that bypass the Guest OS in accessing memory?). I'm still tweaking for optimum performance settings.

0 Kudos
Bruce_Schmitt
Contributor
Contributor

The excess HD access appears to be tied to XP's paging file/virtual memory (and the particular software application). Experimenting with my software application in XP as a VM Guest and as real PC, the same problem crops up. The XP memory manager starts forcing excess swapping to the HD (with 2048 Mb allocated for the Guest or real PC and my application using up only ~200 Mb). I turned paging file off in XP and as expected, no excess HD accessing and performance stays fast.

Bottom line, this may not be a VM issue at all, but between XP and a particular application as it appears that the XP memory management is swapping out memory too early/frequently. I normally don't load more than 500Mb in memory at time (on purpose anyway), so for now, having paging file off is stable ... but of course, not recommended. Anybody else seeing this (likely with large memory applications)? Thanks.

0 Kudos
tink044
Contributor
Contributor

For what it's worth... my new memory settings.

memsize = "3600"

MemAllowAutoScaleDown = "TRUE"

prefvmx.minVmMemPct="100"

mainMem.useNamedFile="FALSE"

sched.mem.pshare.enable="FALSE"

MemTrimRate="0"

Some of it may help.

-Kristian

0 Kudos