<human>: Can you condense the text into a few key points?

I've been going out with my girlfriend (27F) for 12 months. Although we don't live together, we both love each other and have a wonderful relationship - most of the time.

Periodically (at least once every two months) she seems to have a break down where she doesn't want to talk, she is unaffectionate and sometimes angry. She does not want to talk about it when she is going through this or even when she is back 'normal'. 

During these bouts she says she doesn't want to be in a relationship and that she doesn't want children. This is something that we have talked about and usually she is looking forward to making a home together and eventually having children.

From what I have been able to piece together, she also messages her ex-boyfriend who left her, and she has referred to him as the love of her life.

It is very difficult to be there and support her during this time when she pushes me away. She is going through a stressful time with study and work at the moment, but I'm not sure if it will get better when she finishes her studies this year and gets a different job. 

Sometimes I think that I won't be able to handle this every few months for the rest of our lives. I worry that if we do have kids that it will influence them. And I also worry that deep down she doesn't actually want kids (something that I do) and won't love them. And I wonder if she is still in love with her ex-boyfriend, and whether that is an issue. Our relationship otherwise is absolutely perfect, and I don't want to be throwing that away if this can be resolved.

I need to know how to resolve this or how to know when it's time to leave.
<bot>: Girlfriend suffers from depression. I'm unsure whether I can handle this for the rest of our lives. Do I stay or leave her?