发明名称 Distributed memory allocation in multi-threaded programs
摘要 Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for distributed memory allocation. The system identifies a consumer thread which allocates substantially more memory blocks than it deallocates and a producer thread which deallocates substantially more memory blocks than it allocates. The system establishes a dedicated channel for direct allocation and deallocation between the consumer thread and the producer thread.
申请公布号 US9063668(B1) 申请公布日期 2015.06.23
申请号 US201213558246 申请日期 2012.07.25
申请人 Google Inc. 发明人 Jung Changhee;Rus Silvius V.;Sharif Ahmad
分类号 G06F3/06;G06F9/50;G06F17/30 主分类号 G06F3/06
代理机构 Fish & Richardson P.C. 代理人 Fish & Richardson P.C.
主权项 1. A method implemented by data processing apparatus, the method comprising: executing a process on the data processing apparatus wherein the process comprises a plurality of threads and a global memory manager, wherein the global memory manager is configured to process requests from threads of the plurality of threads to allocate and deallocate memory blocks within the process; identifying a consumer thread of the plurality of threads wherein the consumer thread allocates more memory blocks using the global memory manager than the thread deallocates using the global memory manager, wherein a difference between measures of memory block allocation and deallocation for the consumer thread is beyond a first threshold, wherein identifying the consumer thread comprises: selecting two or more threads of the plurality of threads that each have a respective measure of memory block allocation using the global memory manager that is greater than a respective measure of memory block deallocation using the global memory manager;determining a respective consumption rate for each of the selected threads as the difference between the thread's respective measures over time; andidentifying as the consumer thread the selected thread having a highest respective consumption rate; identifying a different producer thread of the plurality of threads wherein the producer thread deallocates more memory blocks using the global memory manager than the thread allocates using the global memory manager, wherein a difference between measures of memory block deallocation and allocation for the producer thread is beyond a second threshold; based on identifying the consumer and producer threads, establishing a first channel between the consumer thread and the producer thread through which references to deallocated memory blocks of the producer thread can be sent to the consumer thread; configuring the producer thread to subsequently deallocate memory blocks by sending references to the memory blocks to the consumer thread using the first channel instead of using the global memory manager to deallocate the memory blocks; and configuring the consumer thread to subsequently allocate memory blocks using the references to the memory blocks provided on the first channel by the producer thread instead of using the global memory manager to allocate the memory blocks.
地址 Mountain View CA US
您可能感兴趣的专利