Skip to main content

Can I limit the memory usage for different ClassLoader?

Please note these java.net forums are being decommissioned and use the new and improved forums at https://community.oracle.com/community/java.
No replies
shan263cn
Offline
Joined: 2011-11-20

Hi,

My concerning is to limit the memory usage for different web applications under one Jetty container. Every one knows that the total memory resource for one JVM is limited. If I want to run more than one applications in one Jetty container, the worst case is that one application consumes too many memory resource and does not release them in time so the other ones may encounter OOM exception. How can I limite the memory usage for every application under the Jetty container to prevent such exception?

Since each web application will use different ClassLoader while sharing the same JVM, so can I limit the memory usage on the classloader level?

Or if can I know the memory usage for every one under such case?

Thanks!