A method for resource allocation and a terminal device are provided. The method includes the following operations. A management module of an operating system receives a scenario data package from a target application that is currently running, where the scenario data package contains a scenario associated information of the target application. A strategy module of the operating system determines a performance improvement strategy for the target application according to the scenario data package. The operating system adjusts allocation of system resources for the target application according to the performance improvement strategy.