Ryan Albrecht
04/11/2023, 9:07 PMbdw429s
04/11/2023, 9:20 PMBOX_SERVER_JVM_HEAPSIZE=2g
bdw429s
04/11/2023, 9:20 PMserver.json
valuesbdw429s
04/11/2023, 9:21 PMRyan Albrecht
04/11/2023, 10:22 PMsknowlton
04/12/2023, 1:03 PMsknowlton
04/12/2023, 1:03 PMbdw429s
04/12/2023, 1:03 PMbdw429s
04/12/2023, 1:04 PMbdw429s
04/12/2023, 1:04 PMRyan Albrecht
04/12/2023, 1:04 PMsknowlton
04/12/2023, 1:04 PM"jvm":{
"args" : "-XX:+UseParallelGC -XX:GCTimeRatio=4 -XX:AdaptiveSizePolicyWeight=90 -XX:MinHeapFreeRatio=20 -XX:MaxHeapFreeRatio=70 -XX:InitialRAMPercentage=35 -XX:MaxRAMPercentage=90"
},
in server.jsonsknowlton
04/12/2023, 1:05 PMsknowlton
04/17/2023, 1:23 PMBOX_SERVER_JVM_HEAPSIZE
is saying 'hey commandbox, use exactly this much as your max heap size' -- this seems like a bit of a philosophical disagreement. given a physical server of RAM constraint X and some number (let's say 1-3) of CFML containers running on it, what's your strategy for provisioning heap sizes? ideally the max of all of them would be greater than the total RAM of the machine on the assumption that not all 3 containers are going to hit max consumption at one time (if indeed the deployment makes that sufficiently unlikely); otherwise you're leaving RAM on the table, yes?bdw429s
04/17/2023, 6:21 PMjclausen
04/17/2023, 6:28 PMReservedCodeCacheSize
is an important one for larger applications with many components. Here’s an example of my defaults for a larger application:
-Dfile.encoding=UTF8 -Djava.awt.headless=true -XX:ReservedCodeCacheSize=256m -Xms3072m -Xmx3072m -XX:+UseG1GC
jclausen
04/17/2023, 6:29 PMMinHeapFreeRatio
is a good one if you are wanting to force GC early. I’ve found that G1GC, though, doesn’t require all of the specific args.sknowlton
04/17/2023, 6:30 PMjclausen
04/17/2023, 6:34 PMXms
. With Parallel, you’re going to have to tune it a bit because it will stop application threads while collecting - and you need the extra args to prevent it being too painful. Parallel GC also has diminishing returns in performance as you go above 1GB in heap size.jclausen
04/17/2023, 6:37 PMbdw429s
04/17/2023, 6:43 PMsknowlton
04/17/2023, 6:58 PMsknowlton
05/01/2023, 4:16 PMbdw429s
05/01/2023, 4:21 PMbdw429s
05/01/2023, 4:21 PMsknowlton
05/01/2023, 4:21 PMbdw429s
05/01/2023, 4:26 PMbdw429s
05/01/2023, 4:27 PMbdw429s
05/01/2023, 4:28 PMsknowlton
05/01/2023, 4:31 PMbdw429s
05/01/2023, 4:43 PMsknowlton
05/01/2023, 4:44 PMbdw429s
05/01/2023, 4:44 PM--add-opens
jvm args for any java modules you are calling via reflectionbdw429s
05/01/2023, 4:44 PM--argh-just-make-it-work-like-it-used-to
JVM argbdw429s
05/01/2023, 4:45 PMsknowlton
05/01/2023, 4:45 PMbdw429s
05/01/2023, 4:45 PMbdw429s
05/01/2023, 4:45 PMbdw429s
05/01/2023, 4:45 PMbdw429s
05/01/2023, 4:46 PMbdw429s
05/01/2023, 4:47 PMbdw429s
05/01/2023, 4:48 PMbdw429s
05/01/2023, 4:49 PMbdw429s
05/01/2023, 4:50 PMsknowlton
05/01/2023, 4:51 PMbdw429s
05/01/2023, 4:51 PMjava.lang.reflect.InaccessibleObjectException: Unable to make public sun.java2d.HeadlessGraphicsEnvironment(java.awt.GraphicsEnvironment) accessible: module java.desktop does not "exports sun.java2d" to unnamed module @45f95ac0
and the fix is to add a JVM arg of
--add-exports=java.desktop/sun.java2d=ALL-UNNAMED
Note there are two flavors of the error-- one for opens and one for exportsbdw429s
05/01/2023, 4:52 PMbdw429s
05/01/2023, 4:52 PM