What is the maximum memory that could be allocated for JVM heap size for a CF10 instance and what should be the minimum.
Depends on a number of factors. Is operating system and CF 32 or 64 bit? If 32 bit on Windows then max heap can be 1024m. If 64 bit it depends more on the available free memory EG for a Windows server with 8Gb RAM max of 4096m or 5124m can work ok.
Many times setting minimum heap to the same as maximum can work well.
Do not forget to check Permsize (Java 7) or Metaspace (Java 8) is suitably defined for the amount of class objects loaded in memory.
Thank you for the valuable reply.
Our environment set up is like, the operating system is Win 2012 R2 Standard 64-bit and CF10 64-bit with 3 CF instance for 3 different websites excluding CFUSION. We have about 16GB of RAM with 4 virtual Processors. Now please suggest me how I should work on JVM allocation for this setup
Sure I would be glad to offer some guidance tho without performinmg some Java monitoring it can be best guess wins.
Before jumping in what update level is CF10 and what Java version is in use?
Can be a good idea to make a copy of each jvm.config before changes case I give you bad direction or typo and CF10 instance does not start.
A customer asked me for some notes on upgrading their CF10 Java 7 to Java 8. I thought I would post a copy here case you want to do similar. While it is fresh on my mind after responding to another of your threads.
CF10 update 14+ provides support for Java 8. Just updating CF10 will not increment the Java from Oracle EOL 7 to 8.
How to CF10 Java 7 to 8?
Download Oracle JDK 8 and install it. Note perhaps use custom method to specify location and you do not need source or public JRE.
Is there anything in the \ColdFusion10\instance\stubs folders?
Have you added SSL certificates CER files to CF Java 7 keystore with keytool?
No for both above then carry on.
Take a copy of \ColdFusion10\intance\bin\msvcr100.dll and \ColdFusion10\instance\lib\tools.jar so you got a backup.
Stop CF service.
Edit JVM.CONFIG (ColdFusion10\instance\bin) and point Java home to new path.
Replace msvcr100.dll and tools.jar with the ones from JDK\bin EG \Program Files\Java\jdk1.8.0_60\bin and JDK\lib EG \Program Files\Java\jdk1.8.0_60\lib.
Start CF service and login to CFadmin (http or https URL/cfide/administrator/index.cfm) > System Information to check Java environment is as expected.
Congratulations CF10 is using Java 8.
There is some more to consider. Java 7 consumed PermSize, Java 8 consumes Metaspace
so PermSize parameters will syntax error when CF starts. Edit JVM.CONFIG and remove "Perm" values replacing with similar Metaspace.
# Arguments to VM
#java.args=-server ... -XX:MaxPermSize=192m etc
java.args=-server ... -XX:MaxMetaspaceSize=192m etc
Worth mentioning here that 192m is not a lot of space for objects. One could do well to make that bigger
Java 8 on 64 bit enables 1Gb of memory for Compressed Class Space. Perhaps you can decrease that.
# Arguments to VM
... -XX:MaxMetaspaceSize=192m -XX:CompressedClassSpaceSize=256m etc
Restart CF to apply.
Thank you very much for the reply Carl. I will try these setting.
Could you please check and let me know if the setting discussed in below URL is correct. It also says similar changes that you suggest but a small change in the replacing msvcr100.dll and tools.jar files. Please confirm.
Yes indeed replace msvcr100.dll and tools.jar .
At this point with 3 instances on 16Gb RAM total I think collector changes to CMS (mentioned in reference) or G1GC might not be wise.
So plenty of discussion on Java 8 and non heap values for metaspace and compress class. Your initial question was what heap size has not been answered.
I presume the 3 instances are currently set to default CF10 setting of maximum 512m or -Xmx512m in JVM.CONFIG. Before suggesting a value how much free RAM does TASKMGR display?
Carl, the CompressedClassSpaceSize setting is not applicable unless
UseCompressedOops is turned on and
UseCompressedClassesPointers is used. See: https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gctuning/considerations.html
UseCompressedOops on Java 8 JVM is enabled by default on 64 bit Windows.
I have preferred to define a smaller limit than 1Gb to compressed class size. I have not trialled excluding it from then JVM with say -XX:-UseCompressedOops so for now would prefer not to offer that as a suggestion.
In this thread 3 instances of CF10 on Java 8 each allocating 1Gb for compressed class size is a fair amount of the available RAM. In practice I have not seen more than 34Mb of that consumed tho payloads can be different so I figure over 250Mb is generous.
Warm Regards, Carl