Out of memory error when running with mvn jetty:run

1,258 views
Skip to first unread message

Aymer

unread,
Jul 28, 2013, 7:24:21 AM7/28/13
to ninja-f...@googlegroups.com
Hi Ninja team,

I'm running into the following error while running application with jetty:run and do a update-save(on ApplicationController.java)-refresh multiple times (around 7-8 ). 
Its reproducible on my laptop with Ubuntu 13.04 64 bit. 

The application was created using 
mvn archetype:generate -DarchetypeGroupId=org.ninjaframework -DarchetypeArtifactId=ninja-core-demo-archetype

[WARNING] failed org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@7d98a1be......
java.lang.OutOfMemoryError: PermGen space..
..

I'm wondering if its only me or its a bug. Let me know if you want me to raise a ticket.

Thanks
Aym

Aymer

unread,
Jul 28, 2013, 7:53:42 AM7/28/13
to ninja-f...@googlegroups.com
Never mind, exporting MAVEN_OPTS with "-Xmx512m -XX:MaxPermSize=256m" resolves the issue.

Raphael André Bauer

unread,
Jul 29, 2013, 3:11:45 AM7/29/13
to ninja-f...@googlegroups.com
On Sun, Jul 28, 2013 at 1:53 PM, Aymer <ayme...@gmail.com> wrote:
> Never mind, exporting MAVEN_OPTS with "-Xmx512m -XX:MaxPermSize=256m"
> resolves the issue.


Hi Aymer,


I am usually using
MAVEN_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256m -XX:MaxPermSize=512m
-XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"

But getting PermGen exception is a symptom, and setting large memory
settings does not prevent the issue. It just mitigates the problem -
long enough so that it is not an issue for me any more...

To determine the underlaying issue have a look at:
http://java.jiderhamn.se/2011/12/11/classloader-leaks-i-how-to-find-classloader-leaks-with-eclipse-memory-analyser-mat/


Best,


Raphael

Aymer

unread,
Jul 30, 2013, 11:25:56 PM7/30/13
to ninja-f...@googlegroups.com
Thanks, I'll check.

I think I'm okay if its due to Classloader leak, as I can restart whenever it blows up :).
Will keep an eye anyway, if ever shows up when running in prod mode.

-Aym

Raphael André Bauer

unread,
Jul 31, 2013, 3:40:41 PM7/31/13
to ninja-f...@googlegroups.com
On Wed, Jul 31, 2013 at 5:25 AM, Aymer <ayme...@gmail.com> wrote:
> Thanks, I'll check.
>
> I think I'm okay if its due to Classloader leak, as I can restart whenever
> it blows up :).
> Will keep an eye anyway, if ever shows up when running in prod mode.

It may only show up if you are using hot deploys on e.g. Tomcat /
Jetty and so on. But this is not really a Ninja issue. And Tomcat and
similar application servers do have a range of workarounds in place
(See e.g. http://wiki.apache.org/tomcat/MemoryLeakProtection).

If you want to find the root MAT is a really cool tool to do so :)
I don't use hot deploys, so for me that was never an issue. (It is
also not an issue if Ninja is running on Google App Engine).


Cheers,


Raphael
Reply all
Reply to author
Forward
0 new messages