A native of Barrow upon Humber in North Lincolnshire, and the son of an engineer, Malim joined the Royal Navy as a cadet on leaving Weymouth College in 1936. In 1941 he was posted to the light cruiser in Scapa Flow and was promoted lieutenant in July of that year. On 13 August 1942, "Manchester" was torpedoed by two Italian Navy MS-boats while part of a convoy to Malta during the Battle of the Mediterranean, and the ship was so severely damaged that her Captain decided to sink her. Making it to dry land, Malim found himself on the coast of Algeria, where he was arrested by the forces of Vichy France and interned at Laghouat. He was freed in November, thanks to the Allied invasion of French North Africa, and a few weeks later joined the heavy cruiser in the North Atlantic. He was next posted to the Royal Naval College, Greenwich, from 1943 to 1945.