Limit memory

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

Limit memory

Per Qvindesland
Hi All

I am a bit of a newbie with jetty so please excuse if this is a n00b question.

I am using jetty 8 on a debian box.

On this machine every second day or so it seems hog to much memory and we're getting alerts of to much memory usage, restarting jetty takes care of the issue, but it's less then a good workaround.

Is there any way of limiting jetty's memory usage? I ps -ef | grep jetty8 gives /usr/lib/jvm/default-java/bin/java -Xmx768m which suggests that there is already a memory limit in use but as I mentioned jetty every now and so often starts using memory way to much so I don't think it's using the limitation.

Any ideas or suggestions is greatly appreciated.

Regards
Per

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Limit memory

Jesse McConnell
First off, Jetty 8 is very end of life, we just released Jetty 9.4 a week or two ago.  Jetty 9.2 if you are stuck on Java 7 which you really shouldn't at this point, it too is EOL.

Second, Jetty is very rarely the cause of a memory leak, more likely the application you are running inside of Jetty is misbehaving in some way.  There is little Jetty can do to force an application to behave in this way, you are pretty limited in what your options are there.  Your best bet is to limit the memory of the JVM you are starting through the command line arguments of java.  AFAIK those limits to the jvm are not fungible to any great degree so if you see growth beyond it would be a factor of the OS/JVM interactions, etc.

cheers!
Jesse

--
jesse mcconnell
[hidden email]

On Fri, Dec 30, 2016 at 6:32 AM, Per Qvindesland <[hidden email]> wrote:
Hi All

I am a bit of a newbie with jetty so please excuse if this is a n00b question.

I am using jetty 8 on a debian box.

On this machine every second day or so it seems hog to much memory and we're getting alerts of to much memory usage, restarting jetty takes care of the issue, but it's less then a good workaround.

Is there any way of limiting jetty's memory usage? I ps -ef | grep jetty8 gives /usr/lib/jvm/default-java/bin/java -Xmx768m which suggests that there is already a memory limit in use but as I mentioned jetty every now and so often starts using memory way to much so I don't think it's using the limitation.

Any ideas or suggestions is greatly appreciated.

Regards
Per

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Limit memory

Per Qvindesland
Hi Jesse

Sweet many thanks for the response.

Yeah an update of Jetty is planned, but only for later in 2017.

is there any debug logging I could turn on that might shed some more lights on what's causing this?

Regards
Per




On Fri, Dec 30, 2016 at 5:37 PM, Jesse McConnell <[hidden email]> wrote:
First off, Jetty 8 is very end of life, we just released Jetty 9.4 a week or two ago.  Jetty 9.2 if you are stuck on Java 7 which you really shouldn't at this point, it too is EOL.

Second, Jetty is very rarely the cause of a memory leak, more likely the application you are running inside of Jetty is misbehaving in some way.  There is little Jetty can do to force an application to behave in this way, you are pretty limited in what your options are there.  Your best bet is to limit the memory of the JVM you are starting through the command line arguments of java.  AFAIK those limits to the jvm are not fungible to any great degree so if you see growth beyond it would be a factor of the OS/JVM interactions, etc.

cheers!
Jesse

--
jesse mcconnell
[hidden email]

On Fri, Dec 30, 2016 at 6:32 AM, Per Qvindesland <[hidden email]> wrote:
Hi All

I am a bit of a newbie with jetty so please excuse if this is a n00b question.

I am using jetty 8 on a debian box.

On this machine every second day or so it seems hog to much memory and we're getting alerts of to much memory usage, restarting jetty takes care of the issue, but it's less then a good workaround.

Is there any way of limiting jetty's memory usage? I ps -ef | grep jetty8 gives /usr/lib/jvm/default-java/bin/java -Xmx768m which suggests that there is already a memory limit in use but as I mentioned jetty every now and so often starts using memory way to much so I don't think it's using the limitation.

Any ideas or suggestions is greatly appreciated.

Regards
Per

_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users


_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Limit memory

John English
In reply to this post by Jesse McConnell
On Fri, Dec 30, 2016 at 6:32 AM, Per Qvindesland wrote:
>     Is there any way of limiting jetty's memory usage? I ps -ef | grep
>     jetty8 gives /usr/lib/jvm/default-java/bin/java -Xmx768m which
>     suggests that there is already a memory limit in use but as I
>     mentioned jetty every now and so often starts using memory way to
>     much so I don't think it's using the limitation.

Chances are it's a memory leak in your code; e.g. ResultSets from a DB
query not being closed properly in all cases. If you enable JMX you can
use it to take a snapshot of memory usage; IIRC Eclipse has a handy
plugin to let you analyse the dump to look for leaks.

HTH,
--
John English
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users
Reply | Threaded
Open this post in threaded view
|

Re: Limit memory

Brian Reichert
In reply to this post by Per Qvindesland
On Fri, Dec 30, 2016 at 07:35:04PM +0000, Per Qvindesland wrote:
> Hi Jesse
>
> Sweet many thanks for the response.

I found what seems to be a memory leak in jetty 9 when using the
hot-deploy feature, I have no idea if there is such a feature in
jetty 8:

  http://dev.eclipse.org/mhonarc/lists/jetty-dev/msg02780.html

> Yeah an update of Jetty is planned, but only for later in 2017.
>
> is there any debug logging I could turn on that might shed some more lights
> on what's causing this?

You can enable GC stats logging:

  http://blog.sokolenko.me/2014/11/javavm-options-production.html

This generate a log that that can be analyzed with any number of
tools, some with a GUI, some not.  That would just show you how
well your current GC tuning is doing, and you may have some wiggle
room there.

I don't know what sort of memory-related alerts you're seeing are.
If they're warnings produced by the JVM itself, you can generate a
heap dump, to see what objects are consuming your heap.

While you can control the size of the heap using misc JVM flags,
if the core java process itself has it's own memory leak (unlikely,
but who knows) you can constrain the process's memory footprint;
see misc man pages for ulimit(1).

  https://www.dynatrace.com/resources/ebooks/javabook/memory-leaks/

>
> Regards
> Per
>
>
>
>
> On Fri, Dec 30, 2016 at 5:37 PM, Jesse McConnell <[hidden email]>
> wrote:
>
> > First off, Jetty 8 is very end of life, we just released Jetty 9.4 a week
> > or two ago.  Jetty 9.2 if you are stuck on Java 7 which you really
> > shouldn't at this point, it too is EOL.
> >
> > Second, Jetty is very rarely the cause of a memory leak, more likely the
> > application you are running inside of Jetty is misbehaving in some way.
> > There is little Jetty can do to force an application to behave in this way,
> > you are pretty limited in what your options are there.  Your best bet is to
> > limit the memory of the JVM you are starting through the command line
> > arguments of java.  AFAIK those limits to the jvm are not fungible to any
> > great degree so if you see growth beyond it would be a factor of the OS/JVM
> > interactions, etc.
> >
> > cheers!
> > Jesse
> >
> > --
> > jesse mcconnell
> > [hidden email]
> >
> > On Fri, Dec 30, 2016 at 6:32 AM, Per Qvindesland <[hidden email]>
> > wrote:
> >
> >> Hi All
> >>
> >> I am a bit of a newbie with jetty so please excuse if this is a n00b
> >> question.
> >>
> >> I am using jetty 8 on a debian box.
> >>
> >> On this machine every second day or so it seems hog to much memory and
> >> we're getting alerts of to much memory usage, restarting jetty takes care
> >> of the issue, but it's less then a good workaround.
> >>
> >> Is there any way of limiting jetty's memory usage? I ps -ef | grep jetty8
> >> gives /usr/lib/jvm/default-java/bin/java -Xmx768m which suggests that
> >> there is already a memory limit in use but as I mentioned jetty every now
> >> and so often starts using memory way to much so I don't think it's using
> >> the limitation.
> >>
> >> Any ideas or suggestions is greatly appreciated.
> >>
> >> Regards
> >> Per
> >>
> >> _______________________________________________
> >> jetty-users mailing list
> >> [hidden email]
> >> To change your delivery options, retrieve your password, or unsubscribe
> >> from this list, visit
> >> https://dev.eclipse.org/mailman/listinfo/jetty-users
> >>
> >
> >
> > _______________________________________________
> > jetty-users mailing list
> > [hidden email]
> > To change your delivery options, retrieve your password, or unsubscribe
> > from this list, visit
> > https://dev.eclipse.org/mailman/listinfo/jetty-users
> >

> _______________________________________________
> jetty-users mailing list
> [hidden email]
> To change your delivery options, retrieve your password, or unsubscribe from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users


--
Brian Reichert <[hidden email]>
BSD admin/developer at large
_______________________________________________
jetty-users mailing list
[hidden email]
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users