[ 
https://issues.apache.org/jira/browse/DIRECTMEMORY-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13176733#comment-13176733
 ] 

Benoit Perroud commented on DIRECTMEMORY-40:
--------------------------------------------

I agree with the "transactionality" or the atomicity of the operation, but this 
can be guarantee with either synchronous blocks or functions as the previous 
implementation did, or using java.util.concurrent primitives like I did with 
j.u.c.Lock.
More over, in my implementation allocation of a new pointer is O(log(n)) : 
finding the next free pointer is O(1), removing from both free list is 
O(log(n)) according to the ConcurrentSkipListMap. Freeing a pointer is 
O(log(n)) because the insertion of the free pointers to the two free list.
The previous implementation was O(1) for freeing the pointer, but O(n) for 
allocation.
                
> Pointers merging with adjacent free pointers when freeing.
> ----------------------------------------------------------
>
>                 Key: DIRECTMEMORY-40
>                 URL: https://issues.apache.org/jira/browse/DIRECTMEMORY-40
>             Project: Apache DirectMemory
>          Issue Type: Improvement
>            Reporter: Benoit Perroud
>         Attachments: MemoryManagerServiceImplTest.java, 
> OffHeapLinkedMemoryBuffer.java, modifiers.patch
>
>
> If one allocates lot of small objects till the buffer is full, and then free 
> those objects, pointers are never merged together to allow further creation 
> of bigger objects.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to