主权项 |
1. A method for managing buffers in a distributed data grid, comprising:
providing, a buffer manager, configured to manage a buffer pool associated with a memory; receiving a first request for a first buffer; in response to receiving said first request, using said buffer manager to allocate a first generation portion of said memory associated with said buffer pool in which to create said first buffer; receiving from requestors a first plurality of requests for buffers and creating first generation buffers in the first generation portion of said memory in response to said first plurality of requests; after said first generation portion of said memory is full, using said buffer manager to allocate a second generation portion of said memory associated with said buffer pool; receiving from requestors a second plurality of requests for buffers and creating second generation buffers in the second generation portion of said memory in response to said second plurality of requests; after said second generation portion of said memory is full, using said buffer manager to allocate a subsequent generation portion of said memory associated with said buffer pool; receiving from requestors a subsequent plurality of requests for buffers and creating subsequent generation buffers in the subsequent generation portion of said memory in response to said subsequent plurality of requests; recycling said first, second, and subsequent generation portions of said memory according to seniority by garbage collecting said first generation buffers, prior to garbage collecting said second generation buffers, and garbage collecting said second generation buffers, prior to garbage collecting said subsequent generation buffers. |