Why does my BMW 328i shuts off periodically? on 1999 BMW 328i

My 1999 BMW 328i runs great then sometimes just shuts off. After a few minutes power cones back on and able to start. Absolutely no power at all when shuts off. Just like baterry has been disconnected. The clock actually will loose time. There is no code.

Asked by for the 1999 BMW 328i
I would check your Battery Connections at the terminals, there may be a loose terminal or a loose main supply cable some where, such as on your starter or under hood power junction.