The loss of material from a star, which may occur at different evolutionary stages and by various processes. A protostar may be the source of a bipolar flow. A T Tauri, giant, or supergiant star may lose mass through a vigorous stellar wind. Ejected material creates a disk around a Be star, or a shell around a Gamma Cassiopeiae star (a shell star); at a late stage of stellar evolution it may give rise to a planetary nebula. Violent ejection occurs in a nova or supernova explosion. Mass loss may also occur through the outer Lagrangian point in a contact binary or overcontact binary system.