How to do an inverted heap implementation in JAVA?

How do you increase your Java jvm heap size in ColdFusion 8?

  • I am trying to increase my java heap size because I am getting some java heap crashes in ColdFusion 8.  I went into c:\coldfusion8\runtime\bin\jvm.config and changed -Xmx to 1024 and -XX:MaxPermSize=512m, and rebooted but I don't think my heap has actually increased (judging my the ColdFusion server memory performance monitor.  Any suggestions?

  • Answer:

    Make both sizes the same.  This isn't always the best answer to your problem, but in general it's better than CF's default.  You've got the starting size set to 1024(but are missing the m), and the max size is set to 512m (half that).  If you weren't going to set them to the same value, those should be reversed.  The lower value is what CF will allocate, and the maxPerm is how much RAM it will allocate to its process--at max. There's a bit of a performance hit sometimes as CF grabs more memory and reaches the MaxPermSize, so some performance gurus will suggest that both of these values should be exactly the same.  In other words, CF will grab 1024m for itself when it restarts, and will never use more than that.  All of that RAM will be allocated/dedicated to CF. The format is #m so 1024m, 512m, etc.  If you have the RAM, I'd go 1024m for both and see what happens. It probably goes without saying that there may be a process that's running out of control on your server, too.  But assuming you've investigated that, there's a really beefy process that needs to run on your CF server, and you just need more RAM allocated to CF, that should do it. :)

Shawn Grigson at Quora Visit the source

Was this solution helpful to you?

Other answers

Did you ever solve your problem here? The jvm.config is indeed the place to modify the jvm args, and for sure if you raised the xmx that should raise the max heap size. You can confirm it has been changed by viewing the CF Admin "java & jvm" page. (Since you refer to the coldfusion8 directory, we can assume you are NOT using the Enterprise multiserver form of deployment, in which case your files would be in a jrun4 directory, and this form of deployment does NOT have a "java & jvm" setting in the CF Admin.) But you say that you viewed things in "the ColdFusion server memory performance monitor", and I'll assume by that you may mean the Server Monitor offered in CF Enterprise (8 and above). If I was to guess, it may be that you are viewing the "memory usage summary" page in the monitor, and it's indeed useful. But one problem with it is that you will see it referring to "max memory" as being the top value of the graph--but beware! That is not necessarily going to equal your xmx value. Sadly, what Adobe labels there as the "max" should really be labelled instead "total memory", as it reflects what's returned by the JVM in a call to its runtime.totalmemory method rather than its maxmemory method. The total memory reflects the amount of heap currently allocated, which may not be anywhere near the max (or it may be.  Indeed, even the maxmemory method would not show EXACTLY the same value as your xmx settting, due to translation of mb values into actual bytes, but it would be close, and a much better value to show.) I'll note that FusionReactor, a 3rd party monitoring tool for FR, shows all 3 values: memory used, allocated, AND max. Anyway, to your original question, I think you'll find that you DID properly edit it, but you've just not been seeing the correct presentation of its having been set.  Hope one of the options above will help you confirm things.

Charlie Arehart

Very late answer but Java 8 doesn't use 'MaxPermSize' as the perm gen region has been removed... more info... http://stackoverflow.com/questions/18339707/permgen-elimination-in-jdk-8

Edward Beckett

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.