Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 149: Implement off-heap cache storage #151

Merged
merged 7 commits into from
Jan 9, 2019

Conversation

eolivelli
Copy link
Contributor

Use Netty Direct ByteBufs to store data.
Introduce refcounting of CacheEntry objects in order to be able to release direct memory

@eolivelli eolivelli closed this Dec 31, 2018
@eolivelli eolivelli reopened this Dec 31, 2018
@eolivelli
Copy link
Contributor Author

I am not really sure that using ByteBufInputStream can be faster that deserializing to a byte[] and then reading data from a ByteArrayInputStream, because ByteBufInputStream will perform a lot of Unsafe operations instead of a single copy from Direct to Heap, only benchmarks will give the answer

@eolivelli
Copy link
Contributor Author

Fixes #149

import java.lang.ref.SoftReference;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Una entry nella cache
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment in italian. Not important

Copy link
Contributor

@caliuf caliuf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 it looks ok

@caliuf caliuf merged commit cc8ed6b into diennea:master Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants