How to set default system java heap Xmx limits?

Solution Unverified - Updated -

Issue

  • I need to set default limits on java processes since my users are over-allocating memory on my servers. I can't use a hard ulimit on virtual memory.

  • I have set JAVA_OPTS="-Xms200m -Xmx2000" in /etc/profile and /etc/csh.login and JAVA_OPTS shows up as an environmental variable when a user logs in, but these defaults are never added to a user's java process/program when it starts.

  • How do I define a default heap size for java processes?

Environment

  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content