1 Reply Latest reply on Dec 24, 2013 7:48 AM by Wolf-Dieter Fink

    heap and permgen size with environement variables

    Niels Vanderbeke Newbie

      Hi,

       

      I am trying to set the heap and permgen size using environemnet variables :

      export JBOSS_DOMAIN_MEM_XMS="512m"

      export JBOSS_DOMAIN_MEM_XMX="512m"

      export JBOSS_DOMAIN_MEM_PERMSIZE="512m"

      export JBOSS_DOMAIN_MEM_MAXPERMSIZE="512m"

       

       

      domain.xml:

      <server-groups>
          <server-group name="telenet-web-server-group" profile="telenet-web">
              <jvm name="default">
                  <heap size="${env.JBOSS_DOMAIN_MEM_XMS}" max-size="${env.JBOSS_DOMAIN_MEM_XMX}"/>
                  <permgen size="${env.JBOSS_DOMAIN_MEM_PERMSIZE}" max-size="${env.JBOSS_DOMAIN_MEM_MAXPERMSIZE}"/>
              </jvm>
              <socket-binding-group ref="standard-sockets"/>
              <deployments>
                  <deployment name="json-monitoring.war" runtime-name="json-monitoring.war"/>
                  <deployment name="isAlive.war" runtime-name="isAlive.war"/>
              </deployments>
          </server-group>
      </server-groups>

       

       

      but when i start i get this error :

      [Server:server-one] Could not create the Java virtual machine.

      10:34:24,439 INFO  [org.jboss.as.process.Server:server-one.status] (reaper for Server:server-one) JBAS012010: Process 'Server:server-one' finished with an exit status of 1

      [Host Controller] 10:34:24,482 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: Admin console listening on http://0.0.0.0:9990

      [Host Controller] 10:34:24,483 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.1.Final "Brontes" (Host Controller) started in 1137ms - Started 11 of 11 services (0 services are passive or on-demand)

      [Host Controller] 10:34:24,534 INFO  [org.jboss.as.host.controller] (ProcessControllerConnection-thread - 2) respawning server: server-one

      10:34:24,569 ERROR [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 3) JBAS012006: Failed to send data bytes to process 'Server:server-one' input stream: java.io.IOException: Broken pipe

              at java.io.FileOutputStream.writeBytes(Native Method) [rt.jar:1.6.0_43]

              at java.io.FileOutputStream.write(FileOutputStream.java:282) [rt.jar:1.6.0_43]

              at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) [rt.jar:1.6.0_43]

              at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109) [rt.jar:1.6.0_43]

              at org.jboss.as.process.protocol.StreamUtils.copyStream(StreamUtils.java:227) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ManagedProcess.sendStdin(ManagedProcess.java:155) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ProcessController.sendStdin(ProcessController.java:175) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ProcessControllerServerHandler$InitMessageHandler$ConnectedMessageHandler.handleMessage(ProcessControllerServerHandler.java:138) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.protocol.ConnectionImpl.safeHandleMessage(ConnectionImpl.java:269) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.protocol.ConnectionImpl$1$1.run(ConnectionImpl.java:223) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_43]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_43]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_43]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

       

      10:34:24,588 INFO  [org.jboss.as.process.Server:server-two.status] (ProcessController-threads - 4) JBAS012017: Starting process 'Server:server-two'

      10:34:24,587 ERROR [org.jboss.as.protocol.connection] (ProcessController-threads - 3) JBAS012111: Failed to read a message: java.io.IOException: Broken pipe

              at java.io.FileOutputStream.writeBytes(Native Method) [rt.jar:1.6.0_43]

              at java.io.FileOutputStream.write(FileOutputStream.java:282) [rt.jar:1.6.0_43]

              at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65) [rt.jar:1.6.0_43]

              at java.io.BufferedOutputStream.write(BufferedOutputStream.java:109) [rt.jar:1.6.0_43]

              at org.jboss.as.process.protocol.StreamUtils.copyStream(StreamUtils.java:227) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ManagedProcess.sendStdin(ManagedProcess.java:155) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ProcessController.sendStdin(ProcessController.java:175) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.ProcessControllerServerHandler$InitMessageHandler$ConnectedMessageHandler.handleMessage(ProcessControllerServerHandler.java:138) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.protocol.ConnectionImpl.safeHandleMessage(ConnectionImpl.java:269) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at org.jboss.as.process.protocol.ConnectionImpl$1$1.run(ConnectionImpl.java:223) [jboss-as-process-controller-7.1.1.Final.jar:7.1.1.Final]

              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_43]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_43]

              at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_43]

              at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.0.0.GA.jar:2.0.0.GA]

       

      10:34:24,596 INFO  [org.jboss.as.process.Server:server-one.status] (ProcessController-threads - 4) JBAS012017: Starting process 'Server:server-one'

      [Server:server-two] Invalid initial heap size: -Xms${env.JBOSS_DOMAIN_MEM_XMS}

      [Server:server-two] Could not create the Java virtual machine.

       

       

       

      Can somme one help me?

        • 1. Re: heap and permgen size with environement variables
          Wolf-Dieter Fink Master

          What you try to achieve?

          The domain/host/process controller can be changed by the domain.conf script.

           

          The different servers you can handle by different JVM configurations and you might use the <properties> element in the domain.xml to override.

          For system environment it is unclear when they take affect.

          If you need to have some properties via command line you can use "-Da.property.for.me=XXX" and use "${a.property.for.me}" to use it from the configuration.

          But be aware that a server starts in a different JVM which might not see that command line properties.