AVR - How to know that there is collision between stack and heap?

I am using the dynamic memory in AVR microcontroller, so How to know that there is collision between stack and heap or if the memory has been filled?

Generally your program will crash shortly after you corrupt the stack.