How can I simulate a low memory condition in Windows 7?

You could use a Virtual Machine (VPC, VMWare or Virtual Box) and tune the memory down.

You could use a Virtual Machine (VPC, VMWare or Virtual Box) and tune the memory down. That is more reliable than a bug. EDIT This suggestion is a way of simulating a PC with less physical memory.As stated in comments and in other answers, if you are looking to tune down virtual memory 'eating away' the heap at the start of the process would be a solution.

The amount of RAM you have is not relevant on a virtual memory operating system like Windows. Not having enough only slows down the program. What matters is the size of the virtual memory address space, 2 gigabytes on a 32-bit operating system.

Set the target platform on your EXE project to x86 if you have a 64-bit operating system. You can arbitrary increase memory pressure by calling Marshal.AllocHGlobal() at the start of your program. Allocate a chunk of, say, 500 megabytes.

Not more, that will fail easily. Grab more by allocating 90 MB chunks.

You are right and I should have been clearer. In attempting to debug this, I've removed the pagefile so my virtual memory is limited to the 12GBs of physical memory – Noah Oct 19 '11 at 21:08.

Not an answer, but a very cool utility I found at The Code Project - Memory Allocation Tool Introduction Sometimes it is very helpful to test your applications in extreme situations like low resources, full hard disk, or low memory conditions. This tool covers just the last - memory. It allows you to allocate as much memory as might be available.

You can: Make Windows pretend it has less memory. Use AppVerifier (only mentioned here for completeness, only works for unmanaged code) Or, if you just want to look, just monitor the collector.

1 Clever, I like it! – Noah Oct 19 '11 at 20:36 1 Because it is not necessarily repeatable and thus unreliable? Because the bug might be fixed tomorrow?

– Stu Oct 19 '11 at 20:50 He asked a solution, this hasn't been fixed yet. This works. He didn't ask a "permanent way to debug".

– Paul Oct 22 '11 at 13:27.

To monitor the activity of your garbage collector and your processes memory usage you can use windows performance counters. To fill your RAM why not allocate a rather large array from a c# program?

Because I think it is caused by the GC and not the memory itself – Noah Oct 19 '11 at 20:38.

You can use a simple C program to allocate or try to allocate arbitrary amounts of memory on the heap: #include #include #define MB (1024*1024) #define DEFAULT_ALLOC ((size_t) (512*MB)); int main(int argc, char *argv) { char buffer2; char *chunk; char *endp; size_t howmuch; if ( argc.

This will consume (virtual) memory of this process, NOT of the . NET application's process – Erno Oct 20 '11 at 6:13.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions