Wednesday, February 03, 2010

EatMemory

a small application which uses the native Win32 API to allocate as much memory as it can (up to 2GB), and verifies it.

Notes:
This application is designed to test the limits of your device's memory. In particular, to test if the HD2's additional 128MB is actually usable or not.

This application will attempt to allocate as much memory as it can, OS limits notwithstanding. The application allocates memory in the OS's shared memory space, which means that it isn't privy to the usual 32MB address space limit.

Because the application isn't limited to 32MB memory usage, you don't need to run multiple instances to consume your memory. Just one instance will do.

This application does not use .NET, and instead uses the direct low-level kernel memory management functions (VirtualAlloc and VirtualFree) to reserve, commit, and free virtual pages. This means that the application has much more precise control over memory, and can consume memory until only a couple of megabytes remain.

This application verifies the memory it allocates, by writing a byte pattern to the memory, and reading it out again. This is necessary because the Windows CE kernel does not commit pages to physical memory unless the memory page is read/written from at least once. This also guarantees that the memory is, in fact, usable and valid.

EatMemory

No comments: