creating C programs to test memory usage
I've been tasked with creating programs to test a new systems performance. Amongs these programs are programs that test memory usage. I need
1) a program that allocates increasingly large memory from the heap
2) A series of programs that have 'a large runtime memory image'
The first was apparently easy to do, just malloc increasingly larger memory sizes. However, when I do that and check the system memory it doesn't seem to change. There is some variation, but it doesn't seem remotely consistent with what my program is doing, presumably the variation is due to memory being used by other programs in the background. Is there a reason that mallocing large portion of memory in my C++ app wouldn't show on system resources?
The second requirement isn't obvious to me. Short of creating a program with 10000 for loops in it I can't think of a way to make the programs run time image is as large as needed.
It's been awhile since I touched C, I've been in Java land the last few years. In fact my C++ knowledge is sadly limited, so it's possible I'm missing something obvious here. Any help would be appreciated
Thank you