[infinispan-issues] [JBoss JIRA] (ISPN-3894) SingleFileStore can optimize space usage by coalescing adjacent free entry blocks.

Rajesh Jangam (JIRA) issues at jboss.org
Wed Jan 15 08:21:32 EST 2014


     [ https://issues.jboss.org/browse/ISPN-3894?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rajesh Jangam updated ISPN-3894:
--------------------------------

    Attachment: CoalesceEntries.java


Please see the attachment CoalesceEntries.java containing a sample program to demonstrate the file size of the store.
Please use this to measure against the original implementation.

Here are the results on my machine:
Original implementation filesize trend (in bytes):
File size: 55004
File size: 4510204
File size: 13365404
File size: 26620604
File size: 44275804
File size: 66331004
File size: 92786204
File size: 123641404
File size: 158896604
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804
File size: 198551804

With the proposed fix:
File size: 55004
File size: 4510204
File size: 13321128
File size: 22135836
File size: 31051712
File size: 39873792
File size: 48736284
File size: 79591484
File size: 92812184
File size: 92812184
File size: 61785872
File size: 4510204
File size: 13321128
File size: 22135836
File size: 31051712
File size: 39873792
File size: 65006232
File size: 79508176
File size: 79508176
File size: 75257128
File size: 75257128
File size: 4510204
File size: 13321128
File size: 22135836
File size: 31051712
File size: 47923940
File size: 66310304
File size: 72789896
File size: 72789896
File size: 75216636
File size: 75216636
File size: 13934324
File size: 13310404
File size: 22125112
File size: 35543064
File size: 53076948
File size: 66304548
File size: 66304548
File size: 66397356
File size: 74923224
File size: 74923224
File size: 4510204

                
> SingleFileStore can optimize space usage by coalescing adjacent free entry blocks.
> ----------------------------------------------------------------------------------
>
>                 Key: ISPN-3894
>                 URL: https://issues.jboss.org/browse/ISPN-3894
>             Project: Infinispan
>          Issue Type: Patch
>          Components: Loaders and Stores
>    Affects Versions: 6.0.0.Final
>         Environment: Oracle JDK 1.7, Windows Server 2008 R2
>            Reporter: Rajesh Jangam
>            Assignee: Mircea Markus
>         Attachments: CoalesceEntries.java
>
>
> This issue is related to 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list