Leinster centre Eoin O'Malley has been forced to retire from rugby due to a long-standing knee problem at the age of just 25.