Bug 1096727 - SingleFileStore can optimize space usage by coalescing adjacent free entry blocks
Summary: SingleFileStore can optimize space usage by coalescing adjacent free entry bl...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ER2
: 6.3.0
Assignee: Tristan Tarrant
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-12 10:48 UTC by Dan Berindei
Modified: 2015-01-26 14:03 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-01-26 14:03:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ISPN-3894 0 Major Resolved SingleFileStore can optimize space usage by coalescing adjacent free entry blocks. 2014-05-23 16:02:29 UTC

Description Dan Berindei 2014-05-12 10:48:12 UTC
This issue is related to bug 1096726 (issue ISPN-3877).

Here we have a use case where the size of the entries gradually keeps on increasing and then finally those entries expire.
1. Smaller entries expire and new bigger entries start getting added
2. These new bigger entries will not fit into the free slots (entries) created due to the expiry of smaller entries.
3. Thus, these new bigger entries only get allocated at the end of the file resulting in growth of file size.

The optimization proposed is to:
1. Coalesce/Combine adjacent free entries during the periodic purge cycle to create bigger/larger free entries.
2. While allocating from an existing free entry, check if the size of the free entry is more than required for the new request being allocated. If yes, then, split the free entry into two free entries:
a. First part equal to the length being requested
This is returned as a part of the allocation activity.
b. Second part equal to the remainder of the space.
This added back as a free entry to the freeList.

Thus free space created due to expiry of smaller entries becomes available for consumption for the larger entries to some extent.
This reduces file size of the store.

Comment 2 Alan Field 2014-05-23 16:02:19 UTC
Verified with JDG 6.3.0 ER5


Note You need to log in before you can comment on or make changes to this bug.