Dumped in Coldfusion

Friday, March 17, 2006

Heap analysis


This is the memory use graph for one of our sites. Does it scream "memory leak" to you? What do I do next to work out what is taking up all of that memory, could it be some sort of harmless Coldfusion caching (I suspect not)?

I like graphs and nice analysis. I don't like sites that go off and sulk without telling me why. More and more I am realising that debugging a site that doesn't break until many people use it is hard unless you have instrumented your system beforehand. You can't just restart it every 5 minutes to put a bit more debugging in, as the people using it get pissed off (Coldfusion taking about 30 seconds to restart doesn't help this).

Thursday, March 02, 2006

Default variable scope

The default scope for variables you use in functions is global. If you want a local variable, you have to declare it at the beginning of your function.

I realised this when I added logging to the end of one of my functions, and discovered that the variables that I was logging had changed value by the logging code. I now understand that this is to be expected with recursive methods.

I don't object to having to declare all my variables as this is a good habit (though hard without decent tool support, is there something as nice as Idea for Coldfusion?).

It seems that these coldfusion UDF tips are a good read, tip 3 tells you to Var your variables to make them local. What sort of madman made them global by default. Ick ick ick.