Reputation: 501
I'm new to valgrind and I was wondering if I can invoke valgrind in such a way that it causes my mallocs to fail for lack of available memory.
Something like: $valgrind helloworld --heapsize=10
Upvotes: 5
Views: 1275
Reputation:
No, valgrind tries to not interfere with the operation of your program. You should be able to use ulimit -d
to restrict the amount of memory available to your program, though, independent of valgrind.
Upvotes: 4