With the rapid growth in cellular user quantity and quality of service demand, the resource allocation in device-to-device communication system significantly affects the overall efficiency and user experience. In this study, the resource allocation for large-scale device-to-device communication system is modelled as a constrained optimization problem with thousands of dimensionalities. Then, the variable-coupling relationship of the developed model is analysed and the mathematical proof is firstly provided, and a novel algorithm namely multi-modal mutation cooperatively coevolving particle swarm optimization is developed to optimize the ultra-high dimensional model. Finally, efficacy of the developed method is verified by a comprehensive set of case studies, some famous algorithms for the specialized literature are also employed for comparison. Experimental results shown that the developed algorithm can obtain accurate and robust optimization performance for different system scales. In addition, when the system scale increases to 1000 cellular users and 300 D2D-pair users, the developed method can still outperform the compared algorithms and output accurate resource allocation solution.