[
https://issues.apache.org/jira/browse/DIRECTMEMORY-55?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Olivier Lamy updated DIRECTMEMORY-55:
-------------------------------------
Fix Version/s: 0.6.0
> OffHeapMemoryBuffer leaks 1 byte at every allocation
> ----------------------------------------------------
>
> Key: DIRECTMEMORY-55
> URL: https://issues.apache.org/jira/browse/DIRECTMEMORY-55
> Project: Apache DirectMemory
> Issue Type: Bug
> Reporter: Benoit Perroud
> Assignee: Benoit Perroud
> Priority: Minor
> Fix For: 0.6.0
>
>
> Discussed here : http://goo.gl/FCkix
> - OffHeapMemoryBuffer shouldn't throw a NPE when store function don't
> find "goodOne" pointer. Should return null instead to allow
> MemoryManagerService to try another buffer if available. See
> testAllocateMultipleBuffers function in the attached class :
> initializing 4 buffers of 4 bytes, I should be able to store 4 objects
> of 4 bytes each.
> - OffHeapMemoryBuffer leaks one byte at every allocation. This is
> because the pointer is 0 indexed, so a pointer starting at 0 and
> ending at 3 is 4 bytes, not 3. See testByteLeaking function :
> initializing 1 buffer of 40 bytes, I should be able to store 10
> objects of 4 bytes each. I would also suggest to have a function
> Pointer.getSize() { return end - start + 1; }
> - OffHeapMemoryBuffer.firstMatch should compare pointer capacity to
> find a match and not only the ending offset. Doing the correct
> comparison will avoid a costly BufferOverflowException.
> - OffHeapMemoryBuffer don't report the correct used size (once the
> leak is removed) when freeing a pointer. See
> testReportCorrectUsedMemory : allocating the whole buffer, freeing a
> pointer, reallocating this pointer. The resulting usage should again
> be the full buffer.
--
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