3 Replies Latest reply on Aug 23, 2006 10:35 AM by peterj

    Problem setting heap size in an embedded server

    smuehlba

      Hi,

      i'm trying to store a file in a hsql-db.
      If the file's too big, i get a java.lang.OutOfMemoryError: java heap space!
      I'm using an embedded server, so my question is, where can i increase heap size? I didn't find anything about heap in my config-files.

      Thanks in adavance

      Best regards

        • 1. Re: Problem setting heap size in an embedded server
          visolvejboss

          Hello,

          You should change the JAVA_OPTS value in the <JBOSS_HOME>/bin/run.conf file to increase the heap size.


          JAVA_OPTS="-server-Xms128m -Xmx512m-Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000"
          


          Here,

          The minimum heap size is 128m and you can set the maximum heap size to any value. Some example parameters for maximum heap size is 512m, 1024m and 2048m.


          • 2. Re: Problem setting heap size in an embedded server
            smuehlba

            Hi,

            sorry, i don't have any run.conf!
            I'm using an EMBEDDED server which is not started by a script.
            The server starts, when the JavaProg runs...
            There are only some xml-files for configuration:

            ejb3-interceptors-aop.xml
            embedded-jboss-beans.xml
            jboss-jms-beans.xml
            log4j.xml
            login-config.xml
            security-beans.xml

            • 3. Re: Problem setting heap size in an embedded server
              peterj

              I have never used the embedded server so please ignore my ignorance, and feel free to ignore my post if it makes no sense.

              Is the server embedded within a Java application? If so, change the heap size for the Java application. Since it is all in one JVM...

              Is the server embedded within a C/C++/??? application? What API call is used to load the server? I know that the standard API function used to load the JVM has a parameter that takes JVM options, and you can add the heap sizes to that parameter.