> We have been seeing a similar problem. A couple of weeks ago
> we put our site on a pair of dedicated servers, one running
> windows 2000/CF4.5 and the other is SQL Server 2000. I was
> noticing that over time that CF Server was gradually chewing
> up more and more RAM without letting it go. Restarting the
> Cold Fusion service freed up the memory, but it would just
> climb again. I changed a lot of the settings in CF Server,
> such as reducing the amount of time and the number of pages
> and queries that will be held in cache, but it did not make
> any appreciable difference.
>
> Once we restarted, the CF memory usage would be down around
> 10 mB, but if someone ran a query with no filtering criteria
> and the entire recordset was returned, it would spike up to
> 150 mB immediately, and never go down. The code is pretty
> streamlined, and the cpu usage averages around 5% with periodic
> spikes up to 50 or 60% for a few milliseconds. I've only seen it
> max out (512 mB) once or twice, and it drops again very quickly.
> There is fairly high traffic on our site, with approximately
> 10,000 visitors per day. Limiting the number of records returned
> did a lot to reduce the amount of RAM used by CFServer, but it
> still creeps up over time. When I have seen the RAM usage climb
> up over 200 mB or so I execute a DOS command, 'kill cfserver',
> which stops and then automatically restarts Cold Fusion Server.
>
> I haven't found a real explanation or solution for this, so
> any insight would be appreciated.
This is the known, documented, behavior of CF 4.5.x, and it's by design.
CF uses a third-party memory manager called SmartHeap. In 4.0.x, the memory
manager was configured to release memory that CF isn't using back to the
operating system. In 4.5.x, it's configured not to release any memory back
to the OS, once that memory has been acquired. The reason for this is that
the process of releasing and reacquiring memory is a relatively expensive
process, and on a properly configured server, it's more efficient for CF to
simply retain the memory once it has been acquired.
This makes sense, if you think about it. Imagine that at peak usage, your CF
server needs 500 Mb of memory. If you're following CF server deployment best
practices, you won't have any other significant services running on the box,
and CF won't have to fight with other services over memory. So, once CF
acquires that 500 Mb at peak usage, it might as well retain it for the next
peak usage period, rather than release it only to have to reacquire it
later.
Of course, there are potential problems with this approach, which favors
performance over stability in some respects:
1. You might be running something else on the machine.
2. You might not have enough memory to really support the peak usage
periods; since CF will grab everything it can get without releasing it, you
might run into permanent "memory starvation" after peak usage. The fix for
this is to add more physical memory.
3. You might have a memory leak with some component of the system. The
biggest culprits here are database drivers. If you have a memory leak in the
database drivers, you'll find out a lot quicker under CF 4.5.x than you
would under 4.0.x. The fix here is to move to a different driver version.
I've run into this problem quite a bit.
You can probably read more about this on the Allaire forums; it was
discussed quite a bit during the 4.5 beta.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496
fax: (202) 797-5444
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
------------------------------------------------------------------------------
To unsubscribe, send a message to [EMAIL PROTECTED] with
'unsubscribe' in the body or visit the list page at www.houseoffusion.com