Skip to content

Always leads to OutOfMemoryError when we use large scalar random keys #9

@xfeep

Description

@xfeep
        Map<Long, Object> map = new NonBlockingHashMap<Long, Object>();
        for (long i = 0;;i++) {
            map.put(i, i);
            map.remove(i);
        }
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
    at org.cliffc.high_scale_lib.NonBlockingHashMap$CHM.resize(NonBlockingHashMap.java:863)
    at org.cliffc.high_scale_lib.NonBlockingHashMap$CHM.access$3(NonBlockingHashMap.java:794)
    at org.cliffc.high_scale_lib.NonBlockingHashMap.putIfMatch(NonBlockingHashMap.java:649)
    at org.cliffc.high_scale_lib.NonBlockingHashMap.putIfMatch(NonBlockingHashMap.java:354)
    at org.cliffc.high_scale_lib.NonBlockingHashMap.put(NonBlockingHashMap.java:313)

It is really serious bug because this make it unusable in many cases.

Same issue was addressed at

  1. https://sourceforge.net/p/high-scale-lib/bugs/14/
  2. http://jsr166-concurrency.10961.n7.nabble.com/Unexpected-memory-usage-in-NonBlockingHashHashMap-td9913.html

In the README file please add some notices about its limitation .

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions