java.lang.OutOfMemoryError: GC overhead limit exceeded on Scala - eclipse

I'M Scala developer,I am getting this error in a Routes file it contains 1008 lines if I add another Line that's throw given below error..
Uncaught error from thread [sbt-web-scheduler-1] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[sbt-web]
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
[ERROR] [04/12/2016 15:17:32.883] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] exception on LARSÆ timer thread
at java.net.URLClassLoader.access$100(Unknown Source)
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:409)
at java.security.AccessController.doPrivileged(Native Method)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at akka.event.Logging$Info$.apply(Logging.scala:665)
at akka.event.BusLogging.notifyInfo(Logging.scala:1140)
at akka.event.LoggingAdapter$class.info(Logging.scala:950)
at akka.event.BusLogging.info(Logging.scala:1128)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:382)
[ERROR] [04/12/2016 15:18:33.808] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] Uncaught error from thread [sbt-web-scheduler-1] at java.lang.Thread.run(Unknown Source)
shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
How Many lines accepted in Routes? How can I solve this?
Editor: Eclipse
Thanks By,
B.UdayaKumar

Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap. In this case, The garbage collector cannot make space available to accommodate a new object, and the heap cannot be expanded further. Also, this error may be thrown when there is insufficient native memory to support the loading of a Java class. In a rare instance, a java.lang.OutOfMemoryError may be thrown when an excessive amount of time is being spent doing garbage collection and little memory is being freed.
You're essentially running out of memory to run the process smoothly. Options that come to mind are:
Specify more memory using the JAVA_OPTS enviroment variable, try something in between like -Xmx1G.
You can also tune your GC manually by enabling -XX:+UseConcMarkSweepGC
For more options on GC tuning refer Concurrent Mark Sweep
Increasing the HEAP size should fix your routes limit problem.

Related

Blocked Thread Exception While Using BR-POP and Socket

We have running 1 vert.x Server connected with redis and DB for running Messenger App.
5~7 people(client) connected to redis simultaneously.
when we send a message to others or do some task processing via Web Socket.
WARNING: Thread Thread[vert.x-worker-thread-4,5,main] has been blocked for 74241 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:141)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:233)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:226)
at redis.clients.jedis.Jedis.brpop(Jedis.java:1716)
at redis.clients.jedis.Jedis.brpop(Jedis.java:3400)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:59)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:50)
at com.ontheit.redis.clients.RedisRequestDaemonClient.getNotify(RedisRequestDaemonClient.java:147)
at com.ontheit.vertx.cache.CacheWorkVerticle.lambda$0(CacheWorkVerticle.java:27)
at com.ontheit.vertx.cache.CacheWorkVerticle$$Lambda$80/1754003563.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273)
at io.vertx.core.impl.ContextImpl$$Lambda$85/1241209246.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$9/1676010932.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
we got this warning
we cant understand that warning came out with current circumstance.
we also can't understand why clients number is too high compare to real user who is using redis server.
how can we solved this?

The error in matlab:Exception in thread "AWT-EventQueue-0" java.lang.​IllegalArg​umentExcep​tion: Comparison method violates its general contract

I started receiving an error in matlab, which prevents me to see the command window but does not prevent the code from executing. I attached all the error message below. I do not know why this is happening but I guess it started after I used "save" commands in the editor. I basically load data into the editor and then preprocess the data so that I can use them later, and I save the new data for future computations. Since when I started saving data, this problem has been initiated. Now, I can't stop matlab to produce this error every time I run any code. Can you please help me with this? I really appreciate that, thank you.
Original error:
Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: Comparison method violates its general contract! at java.util.TimSort.mergeHi(Unknown Source) at java.util.TimSort.mergeAt(Unknown Source) at java.util.TimSort.mergeCollapse(Unknown Source) at java.util.TimSort.sort(Unknown Source) at java.util.Arrays.sort(Unknown Source) at java.util.ArrayList.sort(Unknown Source) at java.util.Collections.sort(Unknown Source) at com.mathworks.widgets.grouptable.GroupingTableUtils.sortNonRecursively(GroupingTableUtils.java:296) at com.mathworks.widgets.grouptable.RowListTransactionTarget.finishTransaction(RowListTransactionTarget.java:115) at com.mathworks.widgets.grouptable.GroupingTableTransaction$1.run(GroupingTableTransaction.java:112) at java.awt.event.InvocationEvent.dispatch(Unknown Source) at java.awt.EventQueue.dispatchEventImpl(Unknown Source) at java.awt.EventQueue.access$500(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.awt.EventQueue$3.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source) >>

Upgrading to JRE7 update 25 causes Applet to crash - extra data given to DerValue constructor

Recently, we upgraded client machines from Java 1.6 to Java 1.7 update 25 and now is encountering problems with IE and Firefox.
Problem occurs each time it will access a applet signed by VeriSign. The exception will be shown: Failed to validate certificate. The Application will not be executed.
java.security.cert.CertificateException: java.security.cert.CertPathValidatorException: java.io.IOException: extra data given to DerValue constructor
at com.sun.deploy.security.RevocationChecker.checkOCSP(Unknown Source)
at com.sun.deploy.security.RevocationChecker.check(Unknown Source)
at com.sun.deploy.security.TrustDecider.checkRevocationStatus(Unknown Source)
at com.sun.deploy.security.TrustDecider.getValidationState(Unknown Source)
at com.sun.deploy.security.TrustDecider.validateChain(Unknown Source)
at com.sun.deploy.security.TrustDecider.isAllPermissionGranted(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.isTrustedByTrustDecider(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.getTrustedCodeSources(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.strategy(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ParentCallback.openClassPathElement(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getJarFile(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.access$1000(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.ensureOpen(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.<init>(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getLoader(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at sun.plugin2.applet.Plugin2ClassLoader.findClassHelper(Unknown Source)
at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
at sun.plugin2.applet.Plugin2Manager.initAppletAdapter(Unknown Source)
at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Suppressed: com.sun.deploy.security.RevocationChecker$StatusUnknownException
at com.sun.deploy.security.RevocationChecker.checkCRLs(Unknown Source)
... 34 more
Caused by: java.security.cert.CertPathValidatorException: java.io.IOException: extra data given to DerValue constructor
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
at sun.security.provider.certpath.OCSP.check(Unknown Source)
... 35 more
Caused by: java.io.IOException: extra data given to DerValue constructor
at sun.security.util.DerValue.init(Unknown Source)
at sun.security.util.DerValue.<init>(Unknown Source)
at sun.security.provider.certpath.OCSPResponse.<init>(Unknown Source)
... 38 more
The applet debug also shows this:
Java Plug-in 10.25.2.17
Using JRE version 1.7.0_25-b17 Java HotSpot(TM) Client VM
User home directory = C:\Users\xxxx
----------------------------------------------------
c: clear console window
f: finalize objects on finalization queue
g: garbage collect
h: display this help message
l: dump classloader list
m: print memory usage
o: trigger logging
q: hide console
r: reload policy configuration
s: dump system and deployment properties
t: dump thread list
v: dump thread stack
x: clear classloader cache
0-5: set trace level to <n>
----------------------------------------------------
CacheEntry[https://xxx:8181/xxx/lib/plugin-loader.jar]: updateAvailable=true,lastModified=Thu Jul 04 09:32:27 SGT 2013,length=1549
CacheEntry[https://xxx:8181/xxx/lib/xxx-applet.jar]: updateAvailable=true,lastModified=Thu Jul 04 09:32:27 SGT 2013,length=879421
Missing Permissions manifest attribute for: https://xxx:8181/xxx/lib/xxx-applet.jar
Missing Codebase manifest attribute for: https://xxx:8181/xxx/lib/xxx-applet.jar
CacheEntry[http://crl.thawte.com/ThawtePremiumServerCA.crl]: updateAvailable=false,lastModified=Thu Jan 01 07:30:00 SGT 1970,length=2520
CacheEntry[http://crl.thawte.com/ThawteCodeSigningCA.crl]: updateAvailable=false,lastModified=Thu Jan 01 07:30:00 SGT 1970,length=2516
As stated by the update from Oracle, we added attribute Trusted-Library: true in the Manifest file but the same error occurs
Trusted-Library: true
We also tried changing the run-time in the server side from 1.6 to 1.7, but no avail. The server is glassfish.
Most probably your/provider/corporate firewall prohibits access to the ocsp.verisign.com, crl.verisign.com,.. or similar, access to they should be visible in Java Console. The worst thing here that firewall provides custom not expected response as for OCSP protocol to Java (or to any client out of allowed URLs) that confuses Java.
Oracle introduced security updates in its Java 7 update 21 release onwards. In which it deprecate the unsigned code and new prompts are introduced for self-signed code. You need to sign the code by CA certificates. Please check the release notes of Java 7 update 21 and update 25

MongoDB java.net.ConnectException: Connection refused

I have problem with used MongoDB
I am testing a web aplication use Jmeter test.
When set up a big load, on the web application, it is right.
When set up a low load but many users, it is beginning exception..
java.net.ConnectException: Connection
refused: connect at
java.net.PlainSocketImpl.socketConnect(Native
Method) at
java.net.PlainSocketImpl.doConnect(Unknown
Source) at
java.net.PlainSocketImpl.connectToAddress(Unknown
Source) at
java.net.PlainSocketImpl.connect(Unknown
Source) at
java.net.SocksSocketImpl.connect(Unknown
Source) at
java.net.Socket.connect(Unknown
Source) at
sun.net.NetworkClient.doConnect(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
Source) at
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:483)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
at java.lang.Thread.run(Unknown
Source)
Tell me please, why..? (I use MongoDB, Tomcat, Java)Thanks..
This is the type of error you should expect to see when load testing any web application with a tool like JMeter, and tells you that you're hitting the upper limit of transactions that the app can support... and this is where you'd do some tweaking of the settings to get better results.
The error message is saying that there are too many HTTP connections going at once and Tomcat is overwhelmed. I'm not sure which version of Tomcat you're on, but it looks like the default for Tomcat 6 is to queue up to 100 requests, then refuse any after that, and maxes out at 200 threads. Try increasing the "acceptCount" or "maxThreads" and see if that helps.
You may also try retagging the question, since this is a broader problem that affects more than just MongoDB apps... and you should get more replies that way. ;)

NoSuchMethod exception when using scala Regex class... confused

I have a simple Scala project that runs without any problems inside Eclipse, however, when packaged into a .jar I receive this exception when running it:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: scala.util.matching.Regex.replaceAllIn(Ljava/lang/CharSequence;Lscala/Function1;)Ljava/lang/String;
What is going on here?...
The code line in question, and the full stack are below.
This is the offending line:
"alt=\"[^>]+\">".r.replaceAllIn(inputStr, {_.replace(">", "/>")})
Full stack:
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: scala.util.matching.Regex.replaceAllIn(Ljava/lang/CharSequence;Lscala/Function1;)Ljava/lang/String;
at com.inosat.fuel.FuelStationDgge.fixhtml(FuelStationDgge.scala:40)
at com.inosat.fuel.FuelStationDgge.setDetails(FuelStationDgge.scala:82)
at com.inosat.fuel.DggeParser$$anon$1.propertyChange(DggeParser.scala:49)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at org.jdesktop.beans.AbstractBean.firePropertyChange(AbstractBean.java:302)
at org.jdesktop.http.async.AsyncHttpRequest.setReadyState(AsyncHttpRequest.java:705)
at org.jdesktop.http.async.AsyncHttpRequest.access$600(AsyncHttpRequest.java:79)
at org.jdesktop.http.async.AsyncHttpRequest$AsyncWorker.done(AsyncHttpRequest.java:831)
at javax.swing.SwingWorker$5.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.run(Unknown Source)
at sun.swing.AccumulativeRunnable.run(Unknown Source)
at javax.swing.SwingWorker$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Unknown Source)
at javax.swing.Timer$DoPostEvent.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Found out what's wrong, Eclipse is using a scala-library.jar from:
C:\eclipse\configuration\org.eclipse.osgi\bundles
and for some reason the jar I copied from Scala's installation folder is not the same.
Fixed by using the same scala-library.jar that Eclipse is using.