Whales sleep while swimming close to another companionable animal, or can rest quietly in a vertical or horizontal position. Young whales usually sleep by swimming slowly close to their mother, who also sleeps while swimming.
A whale must control their blowhole to avoid drowning while sleeping. They usually remember to breathe even during sleep, meaning that a part of the brain must remain partially active. While sleeping, whales tend to swim close to the surface. This allows them to take in air easily whenever they need it. Partial activeness also allows them to watch for predators and obstacles. After some hours, a whale shifts this process, allowing the active part to rest while the inactive part awakens.