{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/315","labels_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/315/labels{/name}","comments_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/315/comments","events_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/315/events","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/issues/315","id":83508280,"number":315,"title":"Async slowness on Jruby","user":{"login":"Sdogruyol","id":990485,"avatar_url":"https://avatars.githubusercontent.com/u/990485?v=3","gravatar_id":"","url":"https://api.github.com/users/Sdogruyol","html_url":"https://github.com/Sdogruyol","followers_url":"https://api.github.com/users/Sdogruyol/followers","following_url":"https://api.github.com/users/Sdogruyol/following{/other_user}","gists_url":"https://api.github.com/users/Sdogruyol/gists{/gist_id}","starred_url":"https://api.github.com/users/Sdogruyol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sdogruyol/subscriptions","organizations_url":"https://api.github.com/users/Sdogruyol/orgs","repos_url":"https://api.github.com/users/Sdogruyol/repos","events_url":"https://api.github.com/users/Sdogruyol/events{/privacy}","received_events_url":"https://api.github.com/users/Sdogruyol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-01T13:50:05Z","updated_at":"2015-06-01T14:15:49Z","closed_at":null,"body":"Trying to process 1 million async calls.\r\n\r\nI'm testing against JRuby-Head (9k) and after some time the process becomes unresponsive and stops processing.\r\n\r\nWhen using CRuby it takes about 2G of Ram but completes without any slowing down.\r\n\r\n```ruby echo.rb  28.85s user 0.90s system 99% cpu 29.779 total```\r\n\r\nHere's the code snippet\r\n\r\n```ruby\r\nrequire 'concurrent'\r\n\r\nclass Echo\r\n  include Concurrent::Async\r\n\r\n  def initialize\r\n    init_mutex # initialize the internal synchronization objects\r\n  end\r\n\r\n  def echo(msg)\r\n    print \"#{msg}\\n\"\r\n    nil\r\n  end\r\nend\r\n\r\nhorn = Echo.new\r\nnumbers = 1_000_000.times.collect { rand }\r\n\r\nnumbers.each do |number|\r\n  horn.async.echo number\r\nend\r\n```\r\n\r\nIs this related to GC on JVM because the memory consumption increases rapidly and then stays nearly the same after some time.\r\n"},"comment":{"url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/comments/107509949","html_url":"https://github.com/ruby-concurrency/concurrent-ruby/issues/315#issuecomment-107509949","issue_url":"https://api.github.com/repos/ruby-concurrency/concurrent-ruby/issues/315","id":107509949,"user":{"login":"Sdogruyol","id":990485,"avatar_url":"https://avatars.githubusercontent.com/u/990485?v=3","gravatar_id":"","url":"https://api.github.com/users/Sdogruyol","html_url":"https://github.com/Sdogruyol","followers_url":"https://api.github.com/users/Sdogruyol/followers","following_url":"https://api.github.com/users/Sdogruyol/following{/other_user}","gists_url":"https://api.github.com/users/Sdogruyol/gists{/gist_id}","starred_url":"https://api.github.com/users/Sdogruyol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sdogruyol/subscriptions","organizations_url":"https://api.github.com/users/Sdogruyol/orgs","repos_url":"https://api.github.com/users/Sdogruyol/repos","events_url":"https://api.github.com/users/Sdogruyol/events{/privacy}","received_events_url":"https://api.github.com/users/Sdogruyol/received_events","type":"User","site_admin":false},"created_at":"2015-06-01T14:15:49Z","updated_at":"2015-06-01T14:15:49Z","body":"@obrok thanks for the response. Here's the command that i used\r\n\r\n```jruby echo.rb -J-Xmx2G```\r\n\r\nUnfortunately I'm still getting the same result. It's like as if the GC pause is increasing rapidly till it nearly blocks the process."}}