The monolithic thin-walled parts are widely used in the aeronautic and astronautic field because of its excellent mechanical performance and light weight, but the thin-walled parts are vulnerable to the machining deformation due to its low stiffness and high material removal rate. According to the relative basic theory, the stiffness and internal residual stress of the part are the critical factors affecting the dimensional stability. In this work, the influences of equivalent bending stiffness and residual stress on the dimensional stability of thin-walled parts are studied. Nine typical thin-walled parts in three groups with two materials (7075 aluminum alloy for A1~A3 and B1~B3, and Ti6Al4V titanium alloy for B4~B6) are machined and treated with different processes. Topology optimization technique is used to optimize the structure of parts to enhance the bending stiffness. Corresponding finite element method (FEM) simulations are carried out to further investigate the generation mechanism. The deformations in 312 hours after machining are measured using coordinate measuring machine, and the deformation changes of the parts are obtained and analyzed. Finally, based on topological optimization and stress relief technology, a machining deformation control method for the monolithic thin-walled parts is proposed. Results show that the maximum and average deformations of thin-walled are evidently decreased using the proposed method.