Based on the available theoretical and half-empirical methods of gerotor design, one optimization scheme of inlet and outlet cavities for a inner engaging cycloidal gerotor has been presented. Experimental investigation has been carried out through bench test, and the results show that 3% and 2.9% increase of the volume efficiency and total efficiency of the gerotor has been achieved respectively through the optimization of inlet and outlet cavities. Then, the numerical investigation of the gerotor has been carried out with the commercial software Pumplinx. The simulation results show a good agreement with the experimental data. The pressure is uniform in most area of the inlet and outlet cavity and cavitation phenomenon has not been detected. The optimization satisfies the design requirements.