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

Use ConcurrentHashMapV8 for lower memory overhead #6400

Closed
wants to merge 2 commits into from

Conversation

Projects
None yet
3 participants
@mikemccand
Copy link
Contributor

commented Jun 3, 2014

In Java8, ConcurrentHashMap has lower memory overhead. We are on Java 7 but can cherry-pick the Java8 impls from Doug Lea's jsr166e work. In addition to CHMV8 I had to pull in some other deps from jsr166e ... I'm not certain they are all required (i.e., they may work with the Java 7 versions?) but I wanted to be safe.

I also fixed a couple places to use ConcurrentCollections to create a new CHM rather then instantiate on their own.


import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;

import jsr166e.ConcurrentHashMapV8;

This comment has been minimized.

Copy link
@jpountz

jpountz Jun 5, 2014

Contributor

This import looks unused?

This comment has been minimized.

Copy link
@mikemccand

mikemccand Jun 5, 2014

Author Contributor

Woops, I'll remove & push ... thanks Adrien.

@jpountz

This comment has been minimized.

Copy link
Contributor

commented Jun 5, 2014

LGTM

@mikemccand mikemccand closed this in 8381426 Jun 5, 2014

mikemccand added a commit that referenced this pull request Jun 5, 2014

Core: switch to the new ConcurrentHashMap implementation coming in Ja…
…va 8

The new implementation has lower RAM overhead and better concurrency
in some cases.

Closes #6400

mikemccand added a commit that referenced this pull request Jun 5, 2014

Core: switch to the new ConcurrentHashMap implementation coming in Ja…
…va 8

The new implementation has lower RAM overhead and better concurrency
in some cases.

Closes #6400

mikemccand added a commit that referenced this pull request Jun 5, 2014

Core: switch to the new ConcurrentHashMap implementation coming in Ja…
…va 8

The new implementation has lower RAM overhead and better concurrency
in some cases.

Closes #6400

@clintongormley clintongormley changed the title Core: use ConcurrentHashMapV8 for lower memory overhead Internal: use ConcurrentHashMapV8 for lower memory overhead Jul 16, 2014

@clintongormley clintongormley changed the title Internal: use ConcurrentHashMapV8 for lower memory overhead Use ConcurrentHashMapV8 for lower memory overhead Jun 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.