摘要 |
Disclosed is a memory sharing method, which is applied to heterogeneous hardware. The heterogeneous hardware is connected to a host. The method of the present invention comprises: acquiring, by heterogeneous hardware, a memory address of the partial memory of a host, which is sent by the host; and when the idle capacity of the memory of the heterogeneous hardware is lower than a predetermined capacity, according to the memory address, storing, by the heterogeneous hardware, the data in the memory of the heterogeneous hardware, which has a usage frequency lower than a predetermined usage frequency, in the partial memory. By means of the memory sharing method provided in the present invention, the data in the memory of the heterogeneous hardware, which has a usage frequency lower than a predetermined usage frequency, can be stored in the partial memory of the host, thereby reducing the storage space of the heterogeneous hardware, which is occupied by the data which has a usage frequency lower than a predetermined usage frequency, in the memory, so that the idle storage space of the heterogeneous hardware is increased, thereby providing more memory space for an application running on the heterogeneous hardware. |