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

+ reduce memory use in binary GET #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

+ reduce memory use in binary GET #3

wants to merge 1 commit into from

Conversation

tootedom
Copy link

Hi,

I noticed that a byte[] array of the size of the content fetched from memcached is created for every GET that is successful, in order to represent a errorMsg. This results in a lot of memory allocations, that are subsequently not used.

This PR (which I originally opened against dustin/java-memcached-client) removes the byte[] allocation in the SUCCESS scenario, removing allocation pressure. The below screen shots are from a JMC view of a flight recorder profile showing the removal of GB's of allocations from a load test that simulates 760,000 gets for 26k of content stored in memcached. Removing the allocations, allowed another 70k of requests to be generated by the load test.

Apologies if the two repositories are the one in the same thing, and for the duplicate pull requests, I'm not sure which git repo own the publishing of the maven artifact (http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22net.spy%22%20AND%20a%3A%22spymemcached%22)

BEFORE
screen shot 2014-05-25 at 13 17 19

AFTER
screen shot 2014-05-25 at 14 05 23

cheers
/dom

@tootedom
Copy link
Author

Thoughts? Wrong project? Too big a change?
If the change is too much you could just remove errorMsg = new byte[errPl.length];

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.

1 participant