The problem of optimizing modular products in reconfigurable manufacturing system is addressed. The problem is first posed as a generalized subset selection problem where the best subsets of module instances of unknown sizes are determined by minimizing an objective function that represents a trade-off between "the quality loss due to modularization" and the cost of reconfiguration while satisfying the problem constraints. The problem is then formulated and solved as an integer nonlinear programming problem with binary variables. The proposed method is applied to the production of a modular drive system composed of a DC motor and a ball screw. The study is a first attempt toward developing a systematic methodology for manufacturing modular products in a reconfigurable manufacturing system.