ColdFusion垃圾回收 [英] ColdFusion Garbage Collection

查看:110
本文介绍了ColdFusion垃圾回收的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在循环负载均衡器上有6台Windows Server 2008 / IIS 7.5 ColdFusion 9.0.2服务器。每个服务器分配2GB的ColdFusion。服务器总共有6GB的内存。垃圾回收似乎是所有服务器上的问题,但是我不确定如何在不回收ColdFusion的情况下解决问题。

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.

下图是过去几天我们6台服务器的AVG / MAX内存。每天,AVG内存都会增加。最终,服务器开始对请求进行排队(因为它们不能足够快地处理它们),我们别无选择,只能回收。

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.

图中的数据已获取从所有6台服务器上的FusionReactor的1m快照中获取。

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

我们的服务器在jvm.config中将以下命令行用于ColdFusion:

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

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

我不确定更改垃圾收集参数是否是解决方案,我对GC一点也不了解,尤其是与ColdFusion有关。

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

我知道这可能与网站上的代码有关。这是一个门户网站(类似保险丝盒),其中包含许多不同的应用程序。门户中cfobject调用的用途不多。

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.

推荐答案

这类似于以下问题: Coldfusion OutOfMemoryError(CF9 / Wheels)

但是,让我强调一些与此相关的内容:

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


  1. 确保您至少使用CF 9.01hf4或9.02hf1并在Java上运行ColdFusion(请在Java 7上参见 ColdFusion 9.01

颠倒`-XX:MaxPermSize = 512m

Bump up the `-XX:MaxPermSize=512m

使用-XX:+ G1GC(请参见 JDK 6u14垃圾优先(G1)垃圾收集器,适用于JRun?

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

使JVM可以使用4GB

Make that the JVM can use 4GB

每100到1000次迭代都会进行一次建议垃圾收集

Every 100 to 1000 iterations do a strongly suggested Garbage Collect

使您的函数保持沉默

请确保函数中的变量是范围为 var local

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

考虑ORM

这篇关于ColdFusion垃圾回收的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆