Giter VIP home page Giter VIP logo

consistent-hashing's Introduction

Hey, I am Dominik ๐Ÿง‘โ€๐Ÿ’ป

GitHub Linkedin Contact

I live in Germany ๐Ÿซ, started working as a Full Stack Developer in 2003 ๐Ÿ‘ด and I am currently working as a Senior Data Engineer at YAZIO๐Ÿ‘จโ€๐Ÿ’ป.

  • ๐Ÿ”ญ Iโ€™m currently working on grooveguessr
  • ๐Ÿ’ป mainly working with Kotlin, Spring Boot and Python in my day job now
  • ๐Ÿฆ€ love Rust
  • I have a keen interest in aviation ๐Ÿ›ซ, football ๐Ÿˆ, and 3D printing

๐Ÿ‘ฏ Communities

consistent-hashing's People

Contributors

domnikl avatar dudleycarr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

consistent-hashing's Issues

Blows Java heap depending on how you init your ring (with a substantial amount of points)

I've been using this lib with jruby (1.7.2 (1.9.3p327) 2013-01-04 302c706 on OpenJDK 64-Bit Server VM 1.7.0_25-b30 [linux-amd64]) for over a year in a project of mine and it's been a workhorse.

I recently needed to use it in a different context where I have a lot more points on my ring and the following code blows the java heap on my development laptop:

irb(main):032:0* require 'consistent_hashing'
=> false
irb(main):033:0> ring = ConsistentHashing::Ring.new; (1..1024).map {|i| ring << i}
Java::JavaLang::OutOfMemoryError: Java heap space
    from org.jruby.util.ByteList.ensure(ByteList.java:341)
    from org.jruby.RubyString.modify(RubyString.java:923)
    from org.jruby.RubyString.cat(RubyString.java:1359)
    from org.jruby.RubyString.cat19(RubyString.java:1324)
    from org.jruby.RubyString.cat19(RubyString.java:1317)
    from org.jruby.RubyArray.inspectAry(RubyArray.java:1486)
    from org.jruby.RubyArray.inspect(RubyArray.java:1510)
    from org.jruby.RubyArray$INVOKER$i$0$0$inspect.call(RubyArray$INVOKER$i$0$0$inspect.gen)
    from org.jruby.runtime.callsite.CachingCallSite.cacheAndCall(CachingCallSite.java:306)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:136)
    from org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:64)
    from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    from org.jruby.ast.RescueNode.executeBody(RescueNode.java:224)
    from org.jruby.ast.RescueNode.interpret(RescueNode.java:119)
    from org.jruby.ast.BeginNode.interpret(BeginNode.java:83)
    from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    from org.jruby.evaluator.ASTInterpreter.INTERPRET_BLOCK(ASTInterpreter.java:112)
    from org.jruby.runtime.Interpreted19Block.evalBlockBody(Interpreted19Block.java:209)
    from org.jruby.runtime.Interpreted19Block.yield(Interpreted19Block.java:197)
    from org.jruby.runtime.Interpreted19Block.call(Interpreted19Block.java:128)
    from org.jruby.runtime.Block.call(Block.java:89)
    from org.jruby.RubyProc.call(RubyProc.java:261)
    from org.jruby.RubyProc.call19(RubyProc.java:249)
    from org.jruby.RubyProc$INVOKER$i$0$0$call19.call(RubyProc$INVOKER$i$0$0$call19.gen)
    from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:208)
    from org.jruby.internal.runtime.methods.DynamicMethod.call(DynamicMethod.java:204)
    from org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:168)
    from org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57)
    from org.jruby.ast.NewlineNode.interpret(NewlineNode.java:105)
    from org.jruby.evaluator.ASTInterpreter.INTERPRET_METHOD(ASTInterpreter.java:75)
    from org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:182)
    from org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:188)

When I however use a similar technique you used in your benchmark script to populate the ring it works fine:

irb(main):041:0* ring = ConsistentHashing::Ring.new; for i in 1..1024; ring << i; end
=> 1..1024

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.