ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Post New Requests Here

IDEA: Testing tool that fills up memory

<< < (2/2)

VideoInPicture:
So it looks like this pretty much just eats virtual memory. Is there something that will eat up "physical" memory?
-Notok (October 06, 2008, 11:25 AM)
--- End quote ---

Hmm, there should be something else out there that could stress both the virtual and physical memory. I'll do a search.

If nothing else, I could just modify that C# stressor tool so that it repeatedly loads an image into memory. That will eat up your ram quick! I had to put in a check for Custom Desktop Logo when I wrote it so that it wouldn't eat up all your system memory if the user tried to load a whole bunch of images into memory so I know it's easily doable.

VideoInPicture:
IDEA: Testing tool that fills up memory1
IDEA: Testing tool that fills up memory2

Attached is the modified version of the memory stressor tool I posted above. I have made it so that this version is able to consume both virtual and physical memory at the same time. I have also changed it so that it consumes between 50%-100% of the available memory, which I think is more relevant for stress testing applications.

It is still command line based. Usage is the same as before. Use the Windows CMD window to run it.

I have tested the program on my computer with about 2GB of ram. The results are shown in the screenshots above. Note the sinusoidal-like pattern of the memory usage in the Task Manager.

Note that I'm not sure what the program will do if you have more than 2GB of ram on your system and the program itself tries to consume more than 2GB of memory. There is a limit to the amount of physical memory the program can access on a 32-bit system so the memory stressor tool itself may shutdown if it runs into this memory limitation. However, I think it is unlikely you will run into this bug on a 32-bit system. It should run fine on a 64-bit system and should be able to access all the physical memory since there is a larger memory address space in 64-bit.

I wasn't able to find a memory stressor tool that would work for application testing. There were too many memory error checking tools listed on Google that made the search results useless. Perhaps someone knows of an already built tool that can do what the attached program does?

f0dder:
VideoInPicture: you can't "consume physical memory" - for usermode windows applications, you're always1 dealing with virtual memory. Virtual memory isn't the same as "stuff that goes in the paging file"...

Really, if you need to check how your application deals with low-memory situations, either use the boot.ini flag, or (if I'm not confusing the tool with another), gflags.exe, which lets you specify evil things like making memory allocations fail etc.

1: there's stuff like the address-windowing extensions which let you (indirectly) deal with physical memory, but that's outside the scope of this rant :)

VideoInPicture:
Perhaps we have different definitions of physical memory. The task manager screenshot does show that I'm consuming physical memory by the task manager's definition.

f0dder:
Perhaps we have different definitions of physical memory. The task manager screenshot does show that I'm consuming physical memory by the task manager's definition.-VideoInPicture (October 09, 2008, 03:04 AM)
--- End quote ---
Slightly, yes :)

The thing is that when you're dealing with memory in usermode Windows, you're dealing with virtual memory. What this means is, basically, that you don't have any control of how this is mapped to physical memory - including whether it's paged out to disk. So you can't really make a tool to "consume physical memory", because windows might very well decided not to give you the memory you're asking for.

Sure, you can stress a system by doing usermode virtual memory allocations, but it's not going to be a reliable test of anything.

Navigation

[0] Message Index

[*] Previous page

Go to full version