Setting the Heap Size for the JVM in JBOSS Application Server 4.0.x

Posted on 2007-10-16
Last Modified: 2013-12-02

1) How do i set the heap size for the JBOSS Application Server Instance , I need to change the  MEM_ARGS=-Xms128m -Xmx256m,

ex: java --Xms128m -Xmx256m where can i edit this setting for my current JBOSS Application Server.

2) How can i tell JBOSS to use a  specific JDK. I am using JBOSS version 4.0.x
Question by:zraees
    LVL 19

    Accepted Solution

    If you are starting it on windows then edit file $JBOSS_HOME/bin/run.bat and add two lines just after @echo off line
    set JAVA_HOME=c:\jdk1.5
    set JAVA_OPTS=-Xms128m -Xmx256m

    of course c:\jdk1.5 should be replaced by path of your Java home.

    ON UNIX:
    edit file $JBOSS_HOME/bin/run.conf there is commented JAVA_HOME setting. Uncomment it and put path to your java home.
    Also there you can find JAVA_OPTS definition. By default it is set to -server -Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000
    just modify it.

    LVL 2

    Expert Comment

    Please set this para meter in JBoss_home/bin/run.conf

    if [ "x$JAVA_OPTS" = "x" ]; then
       JAVA_OPTS="-Xms128m -Xmx512m -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"

    whatever size you want to set
    LVL 19

    Expert Comment

    run.conf read only on UNIX environment.
    LVL 2

    Expert Comment

    For windows environment the run.bat has all parameter so open with text editor and set there

    Featured Post

    Find Ransomware Secrets With All-Source Analysis

    Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

    Join & Write a Comment

    Configure Web Service (server application) I. Configure security for Web Services methods First, we need to protect Session bean which implements the service: 1. Open EJB deployment descriptor (ejb-jar.xml) in the EJB project that contains you…
    This exercise is about for the following scenario: Dmgr and One node with 2 application server. Each application server contains it owns application. Application server name as follows server1 contains app1 server2 contains app1 Prereq…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now