Anxiety attack. Emotional or intellectual failure. Go berserk. Imagine a candle quickly melting into a useless glob, so this phrase implies that someone has completely fallen apart and is no longer able to function properly. (Compare to Set your teeth on edge or Running around like a chicken with it’s head cut off.)
“When I told her we would no longer be dating, she went into a total melt-down.”