BuggleInc / webPLM

Web Interface of the PLM (JavaScript + Play framework)
https://plm.telecomnancy.univ-lorraine.fr
GNU Affero General Public License v3.0
11 stars 14 forks source link

OutOfMemoryError: Java heap space #89

Closed MatthieuNICOLAS closed 8 years ago

MatthieuNICOLAS commented 8 years ago

The following error occured : the Java heap space was full, preventing the server to create any new objects such as lessons or exercises.

Bearing in mind the number of users at the time (probably 1), it is more likely due to a memory leak.

We should profile the application to identify from where this error is coming from.

plm_1          | [debug] application - {"cmd":"runExercise","args":{"lessonID":"welcome","exerciseID":"welcome.lessons.welcome.variables.RunHalf","code":"public void run() { \n  int biscuit=0;\n  int caseOrange=0;\n  while (2 * biscuit != caseOrange + 1){\n    avance();\n    if (estSurBiscuit()){\n      biscuit++;\n    }\n    if (getCouleurBrosse()==Color.orange){\n      caseOrange++;\n    }\n  }\n}"}}
plm_1          | [debug] application - [judge] Acknowledge
plm_1          | [debug] application - [judge] Stream
plm_1          | [debug] application - [judge] Stream
plm_1          | [debug] application - [judge] Stream
plm_1          | [debug] application - [judge] Stream
plm_1          | [ERROR] [07/07/2016 14:48:46.919] [application-akka.actor.default-dispatcher-2992] [ActorSystem(application)] Uncaught fatal error from thread [application-akka.actor.default-dispatcher-2992] shutting down ActorSystem [application]
plm_1          | java.lang.OutOfMemoryError: Java heap space
plm_1          |    at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
plm_1          |    at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
plm_1          |    at org.jboss.netty.buffer.ChannelBuffers.encodeString(ChannelBuffers.java:1157)
plm_1          |    at org.jboss.netty.buffer.ChannelBuffers.copiedBuffer(ChannelBuffers.java:834)
plm_1          |    at org.jboss.netty.buffer.ChannelBuffers.copiedBuffer(ChannelBuffers.java:741)
plm_1          |    at org.jboss.netty.buffer.ChannelBuffers.copiedBuffer(ChannelBuffers.java:711)
plm_1          |    at org.jboss.netty.handler.codec.http.websocketx.TextWebSocketFrame.<init>(TextWebSocketFrame.java:74)
plm_1          |    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$iteratee$1$1.apply(PlayDefaultUpstreamHandler.scala:302)
plm_1          |    at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$play$core$server$netty$PlayDefaultUpstreamHandler$$iteratee$1$1.apply(PlayDefaultUpstreamHandler.scala:298)
plm_1          |    at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$16$$anonfun$apply$17.apply(Iteratee.scala:544)
plm_1          |    at play.api.libs.iteratee.Iteratee$$anonfun$flatMap$1$$anonfun$apply$16$$anonfun$apply$17.apply(Iteratee.scala:544)
plm_1          |    at scala.concurrent.impl.Future$PromiseCompletingRunnable.liftedTree1$1(Future.scala:24)
plm_1          |    at scala.concurrent.impl.Future$PromiseCompletingRunnable.run(Future.scala:24)
plm_1          |    at play.api.libs.iteratee.Execution$trampoline$.executeScheduled(Execution.scala:120)
plm_1          |    at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:71)
plm_1          |    at scala.concurrent.impl.Future$.apply(Future.scala:31)
plm_1          |    at scala.concurrent.Future$.apply(Future.scala:492)
plm_1          |    at play.api.libs.iteratee.RunQueue.execute(RunQueue.scala:122)
plm_1          |    at play.api.libs.iteratee.RunQueue.schedule(RunQueue.scala:115)
plm_1          |    at play.api.libs.iteratee.RunQueue.schedule(RunQueue.scala:66)
plm_1          |    at play.api.libs.iteratee.RunQueue.scheduleSimple(RunQueue.scala:88)
plm_1          |    at play.api.libs.iteratee.Concurrent$$anon$6.schedule(Concurrent.scala:179)
plm_1          |    at play.api.libs.iteratee.Concurrent$$anon$6.push(Concurrent.scala:181)
plm_1          |    at play.api.libs.iteratee.Concurrent$Channel$class.push(Concurrent.scala:50)
plm_1          |    at play.api.libs.iteratee.Concurrent$$anon$6.push(Concurrent.scala:176)
plm_1          |    at play.core.actors.WebSocketActor$WebSocketActorSupervisor$$anonfun$receive$1.applyOrElse(WebSocketActor.scala:74)
plm_1          |    at akka.actor.Actor$class.aroundReceive(Actor.scala:467)
plm_1          |    at play.core.actors.WebSocketActor$WebSocketActorSupervisor.aroundReceive(WebSocketActor.scala:25)
plm_1          |    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516)
plm_1          |    at akka.actor.ActorCell.invoke(ActorCell.scala:487)
plm_1          |    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:238)
plm_1          |    at akka.dispatch.Mailbox.run(Mailbox.scala:220)
mquinson commented 8 years ago

@MatthieuNICOLAS It looks like one of the bugs that you fixed in the recent releases, doesn't it?

MatthieuNICOLAS commented 8 years ago

Since then, we released a new version refactoring the internal architecture and fixing some memory leaks (see 96b26dcfd95a020e26505802de700de72d286211, 1b087ff80bfe8f0d5bb0a6fc2d6f7313dd6a0d05 and c52d7ff1ca83041ea6f6b6703cea644735d61c78). From now on the ressources used by the application seem stable, thus closing this issue.