The design and verification of pressure vessels is governed by the design codes specified by the ASME Boiler and Pressure Vessel Code (BPVC). Convention design satisfying the ASME BPVC code requirements would lead to a conservative design. This situation will to be solvable by modern structural optimization methods. The size optimization of pressure vessel complying with design-by-analysis requirements within the ASME Sec. VIII Division 2 specification is discussed in this paper. This is accomplished by an integrated approach in which the stress analysis is carried out by ANSYS. These results are used by an optimization code in matlab to perform design optimization. The integrated approach is fully automated and applied to the optimal design of a real pressure vessel. The results show that the material used by the pressure vessel can be minimized while satisfying the maximum stress specified in the BPVC.