ColdFusion Garbage Collection

☆樱花仙子☆ 提交于 2019-12-10 19:48:09

问题


We have 6 Windows Server 2008/IIS 7.5 ColdFusion 9.0.2 servers on a round-robin load balancer. Each server is allocated 2GB for ColdFusion. Servers have 6GB of memory total. Garbage collection seems to be an issue across all the servers but I'm not sure how to resolve the issue without recycling ColdFusion.

The graph below is the AVG/MAX memory for our 6 servers over the past few days. Each day the AVG memory increases. Eventually, the servers start queuing requests (because they can't process them fast enough) and we have no choice but to recycle.

The data in the graph was taken from 1m snapshots of FusionReactor across all 6 servers.

Our servers are using the following command line in jvm.config for ColdFusion:

java.args=-Xmx2G -server -Xms2g -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Xbatch -Dcoldfusion.rootDir={application.home}/ -Djava.security.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/coldfusion.policy -Djava.security.auth.policy={application.home}/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/neo_jaas.policy

I'm not sure if changing garbage collection parameters is the solution, and I know nothing about GC especially as it relates to ColdFusion.

I'm aware this may have something to do with the code on the site. It's a portal (something like fusebox) that hosts many different applications inside of it. There are NOT many uses of cfobject calls in the portal.


回答1:


This is similar to this question: Coldfusion OutOfMemoryError (CF9/Wheels)

But let me highlight the ones that are relevant for this:

  1. Make sure you are on at least CF 9.01hf4 or 9.02hf1 and run ColdFusion on Java (See ColdFusion 9.01 on Java 7)

  2. Bump up the `-XX:MaxPermSize=512m

  3. Use -XX:+G1GC (See Is JDK 6u14 Garbage First (G1) garbage collector, suitable for JRun?)

  4. Make that the JVM can use 4GB

  5. Every 100 to 1000 iterations do a strongly suggested Garbage Collect

  6. Make your function silent

  7. Make sure that variables in functions are scoped to var or local

  8. Consider ORM



来源:https://stackoverflow.com/questions/20253684/coldfusion-garbage-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!