jruby OutOfMemoryError

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

jruby OutOfMemoryError

Vara Prasad
Hello,

For one of the requests made to sonarqube as below we are seeing a response of 500 from sonar server. Iam seeing an OOM error on sonar server at the time of request. The response code 500 could be because of OOM on sonar server.
http:host:port/batch_bootstrap/db?project=myproject


The OOM seen is as below
ERROR web[rails]
Java::JavaLang::OutOfMemoryError (Java heap space):
  org.jruby.util.ByteList.<init>(ByteList.java:147)
  org.jruby.util.ByteList.<init>(ByteList.java:132)

The error seems to be coming from jruby.

I do not see a heap dump (Option HeapDumpOnOutOfMemoryError is present for "org.sonar.server.app.WebServer").

The below are the questions,

Are Jruby operations are spawned as separate processes ?
What is the default heap used by Jruby and how to change it ?
Any debug flags to enable to determine the root cause ?

With Regards,
Vara Prasad.
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] jruby OutOfMemoryError

Simon Brandhof
Hi Vara,



Are Jruby operations are spawned as separate processes ?

No, JRuby is embedded into web server process.
 
What is the default heap used by Jruby and how to change it ?
Any debug flags to enable to determine the root cause ?

See property sonar.web.javaOpts in conf/sonar.properties. Default value is -Xmx768m -XX:MaxPermSize=160m -XX:+HeapDumpOnOutOfMemoryError
What's approximately the size of your project (nb of files/lines/issues) ? Moreover what's your version of SonarQube ?

Thanks
Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] jruby OutOfMemoryError

Vara Prasad
This post was updated on .
Thanks Simon.

I debugged the issue further and found that the issue is due to the large file (db) that is being downloaded.

The below is the call that was failing
send_data String.from_java_bytes(db_content)

The file to be downloaded is around is 258MB. (Lines of code is 10,299,946). Using sonar version 4.5.1

After increasing the Xmx to 1536m, we did not see the issue.

Reply | Threaded
Open this post in threaded view
|

Re: [sonar-dev] jruby OutOfMemoryError

Simon Brandhof
Unfortunately that's a known limitation with our JRuby on Rails web services. Responses can't be streamed. That will be fixed when all our JRuby web services will be replaced by pure Java implementations. I can't give you release date of this pending task. 

Regards


Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

On 13 May 2015 at 08:16, Vara Prasad <[hidden email]> wrote:
Thanks Simon.

I debugged the issue further and found that the issue is due to the large
file (db) that is being downloaded.

The below is the call that was failing
send_data String.from_java_bytes(db_content)

The file to be downloaded is around is 258MB. (Lines of code is 10,299,946).
After increasing the Xmx to 1536m, we did not see the issue.




--
View this message in context: http://sonarqube.15.x6.nabble.com/jruby-OutOfMemoryError-tp5035126p5035316.html
Sent from the SonarQube Developers mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email