Here is a simple rule when to define objects on the heap and when to do it on the stack. The stack is much more efficient than the heap. Simple rule: Use the stack when you can. You cannot use the stack if you need the object in other functions. (Stack allocations are deleted when