Tools For Limiting Available Memory
Question
OS: Windows XP
Does anyone know of tools (preferably free) to limit memory available and also other windows resources (handles etc.)? I want to test an app with low memory to make sure it behaves properly and if there are already tools to do this sort of thing, I'd rather not write my own.
By the way, I did look for other Q & A threads for this and didn't find any. If this is a dupe, I apologize. Just let me know and I'll close this up.
Solution
You can use boot parameters to Linux (grub.conf or lilo.conf) and Windows (boot.ini) to adjust the memory size.
On Linux, 'mem=128' in the kernel append line will limit to 128MB.
On Windows, "/MAXMEM=" in boot.ini. (Reference: Boot INI Options Reference)
OTHER TIPS
If you want to test a PC with low physical memory you can use a VM and assign it as little (or as much, if available on the host machine) RAM as you'd like.
You could use the Microsoft Application Verifier tool: http://technet.microsoft.com/en-us/library/bb457063.aspx
This will allow you to simulate low resources as well as many other issues. YMMV with using non-MS heaps, etc.
Reduce the paging memory to zero (Requires a restart). Then the application is restricted to only the physical memory. Helps the cause as paging file default size is 1.5gb in most cases. Trying to throttle the memory for an application will be frustrating with such a big page file.
You can edit boot.ini with the maxmem option:
http://support.microsoft.com/default.aspx?scid=kb;en-us;833721