6 Replies Latest reply: Jun 27, 2012 11:59 AM by 944943 RSS

    problem with maximum heap size

    944943
      Hi. I'm trying to run an old program that I never had problems. Since upgrade 7 - 5, I have an error message: "maximum heap size might be too large or an antivirus or firewall tool could block the execution."

      The program is a simple exe, not necessary to install, easy to download at https://sites.google.com/site/valorizamais/ferramentas/calculadora-de-risco-ganho (1.16MB).

      I'm running windows 7 32 bits.

      I have only one java version installed and it is the most up to date.

      What is wrong? I have disabled avast antivirus and firewall (windows) but nothing changed.
      thanks for any help.
        • 1. Re: problem with maximum heap size
          jschellSomeoneStoleMyAlias
          That is a problem with the application - not java.
          So one must look to the application, not java, for a fix. The application code must be fixed.

          Other than that I can only hope that the error message is wrong since too much memory isn't usually a problem.

          You could try downloading an older VM.
          • 2. Re: problem with maximum heap size
            800268
            jschell wrote:
            Other than that I can only hope that the error message is wrong since too much memory isn't usually a problem.
            Actually it is (at least on Windows) since the JVM tries to allocates all the memory on start up and exits with that error when it can't. On Windows 32bit you can sometimes get it when trying to use a heap greater than ~1250MB.

            @OP: consult the program documentation (or ask the creators of the program) how to specify a smaller heap - since they are using an .exe file you cannot use the standard Java to do it.
            • 3. Re: problem with maximum heap size
              939520
              You might also want to monitor the memory use (profiler) of the running program over several hours/days to see in continues to grow in size. If so, you might have a memory leak in the program.

              FYI:
              You can add something like this to the command line arguments of your JVM to increase the amount of heap memory it can use:
              -Xms512m -Xmx1152m
              • 4. Re: problem with maximum heap size
                jschellSomeoneStoleMyAlias
                Walter Laan wrote:
                jschell wrote:
                Other than that I can only hope that the error message is wrong since too much memory isn't usually a problem.
                Actually it is (at least on Windows) since the JVM tries to allocates all the memory on start up and exits with that error when it can't.
                Presumably there is some additional qualification with that statement since as it stands that isn't true.
                On Windows 32bit you can sometimes get it when trying to use a heap greater than ~1250MB.
                Perhaps on windows 7 with the Xms option?
                • 5. Re: problem with maximum heap size
                  800268
                  jschell wrote:
                  Walter Laan wrote:
                  Actually it is (at least on Windows) since the JVM tries to allocates all the memory on start up and exits with that error when it can't.
                  Presumably there is some additional qualification with that statement since as it stands that isn't true.
                  On Windows 32bit you can sometimes get it when trying to use a heap greater than ~1250MB.
                  Perhaps on windows 7 with the Xms option?
                  Mm, right. I can't reproduce it on Win7 on a 64bit machine with 32bit java with a simple test jar.
                  However, I've seen the error on WinX 32bit with a java program -Xms was in use as well as the program jar being much bigger and lots of extra jars on the class path.

                  Actually: see here for an example, http://javafx-jira.kenai.com/browse/DTL-4515

                  Edited by: Walter Laan on Jun 27, 2012 10:31 AM
                  • 6. Re: problem with maximum heap size
                    944943
                    Thanks all of you, for your explanations and time to help me solve the problem.
                    Well, I didn't solve it yet, but sent the thread to the program developer, maybe he can help me to understand the issue, a litte bit upper my tecnological knowing.
                    If we find a solution, I will post it here in this forum.
                    Thanks again.