We thoroughly study a generalized version of the classic Stable Marriage and Stable Roommates problems where agents may share partners. We consider two prominent stability concepts: ordinal stability [Aharoni and Fleiner, Journal of Combinatorial Theory, 2003] and cardinal stability [Caragiannis et al., ACM EC 2019] and two optimality criteria: maximizing social welfare (i.e., the overall satisfaction of the agents) and maximizing the number of fully matched agents (i.e., agents whose shares sum up to one). After having observed that ordinal stability always exists and implies cardinal stability, and that the set of ordinally stable matchings in a restricted case admits a lattice structure, we obtain a complete picture regarding the computational complexity of finding an optimal ordinally stable or cardinally stable matching. In the process we answer an open question raised by Caragiannis et al. [AIJ 2020].