Linux: manually reduce heap size

view story

http://stackoverflow.com – I'm trying to simulate memory exaustion. So here is what I'm thinking: turn off over commiting. reduce the available heap so that the memory exaustion can happen quicker. Run the program under test. My question is w.r.t 2: is there a trick that reduce the heap size that kernel will allocate? I can probably write another program that allocates a large amount of RAM but there might be a smarter way? (HowTos)