java.lang.OutOfMemoryError

There are no available Samebug tips for this exception. Do you have an idea how to solve this issue? A short tip would help users who saw this issue last week.

  • {noformat} java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:597) at scala.concurrent.forkjoin.ForkJoinPool.createAndStartAddedWorkers(ForkJoinPool.java:524) at scala.concurrent.forkjoin.ForkJoinPool.setParallelism(ForkJoinPool.java:749) at scala.actors.scheduler.ForkJoinScheduler.makeNewPool(ForkJoinScheduler.scala:44) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:15) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:29) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:33) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:37) at scala.actors.Scheduler$.makeNewScheduler(Scheduler.scala:33) at scala.actors.scheduler.DelegatingScheduler$class.newActor(DelegatingScheduler.scala:63) at scala.actors.Scheduler$.newActor(Scheduler.scala:21) at scala.actors.Reactor$class.dostart(Reactor.scala:221) at scala.actors.Actor$$anon$1.scala$actors$Actor$$super$dostart(Actor.scala:132) at scala.actors.Actor$class.dostart(Actor.scala:709) at scala.actors.Actor$$anon$1.dostart(Actor.scala:132) at scala.actors.Reactor$class.start(Reactor.scala:230) at scala.actors.Actor$$anon$1.scala$actors$Actor$$super$start(Actor.scala:132) at scala.actors.Actor$class.start(Actor.scala:713) at scala.actors.Actor$$anon$1.start(Actor.scala:132) at scala.actors.Actor$.actor(Actor.scala:136) at Main$$anon$1$$anonfun$isPerfectConcurrent$1.apply(testActor.scala:18) at Main$$anon$1$$anonfun$isPerfectConcurrent$1.apply(testActor.scala:14) at scala.collection.immutable.Range.foreach(Range.scala:81) at Main$$anon$1.isPerfectConcurrent(testActor.scala:14) at Main$$anon$1.<init>(testActor.scala:32) at Main$.main(testActor.scala:1) at Main.main(testActor.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:78) at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:24) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:88) at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:78) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101) at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:33) at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:40) at scala.tools.nsc.ScriptRunner.scala$tools$nsc$ScriptRunner$$runCompiled(ScriptRunner.scala:171) at scala.tools.nsc.ScriptRunner$$anonfun$runScript$1.apply(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner$$anonfun$runScript$1.apply(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply$mcZ$sp(ScriptRunner.scala:157) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131) at scala.tools.nsc.util.package$.waitingForThreads(package.scala:26) at scala.tools.nsc.ScriptRunner.withCompiledScript(ScriptRunner.scala:130) at scala.tools.nsc.ScriptRunner.runScript(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner.runScriptAndCatch(ScriptRunner.scala:201) at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:58) at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80) at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala) {noformat} and my codes: {code} def sumOfFactorsInRange(lower: Int, upper: Int, number: Int) = { (0 /: (lower to upper)) { (sum, i) => if (number % i == 0) sum + i else sum } } def isPerfectConcurrent(candidate: Int) = { val RANGE = 100000 val numberOfPartitions = (candidate.toDouble / RANGE).ceil.toInt val caller = self for (i <- 0 until numberOfPartitions) { val lower = i * RANGE + 1 val upper = candidate min (i + 1) * RANGE actor { caller ! sumOfFactorsInRange(lower, upper, candidate) } } val sum = (0 /: (0 until numberOfPartitions)) { (partialSum, i) => receive { case sumInRange: Int => partialSum + sumInRange } } 2 * candidate == sum } println("6 is perfect? " + isPerfectConcurrent(6)) {code}
    via by eugene,
  • Hibernate+Ehcache update breaks test suite
    via Stack Overflow by seminolas
    ,
  • How to set native memory in JAVA
    via Stack Overflow by Jabir
    ,
  • Jboss JMS Out Of Memory
    via Stack Overflow by Ravi
    ,
  • OutOfMemoryError using Memcached
    via Stack Overflow by kas3
    ,
  • Java: Unable to create new native thread
    via Stack Overflow by tvfoodmaps
    ,
    • java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:597) at scala.concurrent.forkjoin.ForkJoinPool.createAndStartAddedWorkers(ForkJoinPool.java:524) at scala.concurrent.forkjoin.ForkJoinPool.setParallelism(ForkJoinPool.java:749) at scala.actors.scheduler.ForkJoinScheduler.makeNewPool(ForkJoinScheduler.scala:44) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:15) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:29) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:33) at scala.actors.scheduler.ForkJoinScheduler.<init>(ForkJoinScheduler.scala:37) at scala.actors.Scheduler$.makeNewScheduler(Scheduler.scala:33) at scala.actors.scheduler.DelegatingScheduler$class.newActor(DelegatingScheduler.scala:63) at scala.actors.Scheduler$.newActor(Scheduler.scala:21) at scala.actors.Reactor$class.dostart(Reactor.scala:221) at scala.actors.Actor$$anon$1.scala$actors$Actor$$super$dostart(Actor.scala:132) at scala.actors.Actor$class.dostart(Actor.scala:709) at scala.actors.Actor$$anon$1.dostart(Actor.scala:132) at scala.actors.Reactor$class.start(Reactor.scala:230) at scala.actors.Actor$$anon$1.scala$actors$Actor$$super$start(Actor.scala:132) at scala.actors.Actor$class.start(Actor.scala:713) at scala.actors.Actor$$anon$1.start(Actor.scala:132) at scala.actors.Actor$.actor(Actor.scala:136) at Main$$anon$1$$anonfun$isPerfectConcurrent$1.apply(testActor.scala:18) at Main$$anon$1$$anonfun$isPerfectConcurrent$1.apply(testActor.scala:14) at scala.collection.immutable.Range.foreach(Range.scala:81) at Main$$anon$1.isPerfectConcurrent(testActor.scala:14) at Main$$anon$1.<init>(testActor.scala:32) at Main$.main(testActor.scala:1) at Main.main(testActor.scala) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at scala.tools.nsc.util.ScalaClassLoader$$anonfun$run$1.apply(ScalaClassLoader.scala:78) at scala.tools.nsc.util.ScalaClassLoader$class.asContext(ScalaClassLoader.scala:24) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.asContext(ScalaClassLoader.scala:88) at scala.tools.nsc.util.ScalaClassLoader$class.run(ScalaClassLoader.scala:78) at scala.tools.nsc.util.ScalaClassLoader$URLClassLoader.run(ScalaClassLoader.scala:101) at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:33) at scala.tools.nsc.ObjectRunner$.runAndCatch(ObjectRunner.scala:40) at scala.tools.nsc.ScriptRunner.scala$tools$nsc$ScriptRunner$$runCompiled(ScriptRunner.scala:171) at scala.tools.nsc.ScriptRunner$$anonfun$runScript$1.apply(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner$$anonfun$runScript$1.apply(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply$mcZ$sp(ScriptRunner.scala:157) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131) at scala.tools.nsc.ScriptRunner$$anonfun$withCompiledScript$1.apply(ScriptRunner.scala:131) at scala.tools.nsc.util.package$.waitingForThreads(package.scala:26) at scala.tools.nsc.ScriptRunner.withCompiledScript(ScriptRunner.scala:130) at scala.tools.nsc.ScriptRunner.runScript(ScriptRunner.scala:188) at scala.tools.nsc.ScriptRunner.runScriptAndCatch(ScriptRunner.scala:201) at scala.tools.nsc.MainGenericRunner.runTarget$1(MainGenericRunner.scala:58) at scala.tools.nsc.MainGenericRunner.process(MainGenericRunner.scala:80) at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:89) at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)

    Users with the same issue

    nasimk
    1 times, last one,
    poroszd
    530 times, last one,
    Unknown visitor1 times, last one,
    Reich
    4 times, last one,
    Unknown visitor1 times, last one,
    50 more bugmates