Friday, March 19, 2010

JRun / Apache / jrApache Malloc Errors

I was chatting with a friend to today and this issue was showing up in his Apache logs for an application running on ColdFusion with JRun running on Windows:


[Fri Mar 19 18:01:06 2010] [notice] jrApache[1720: 12042] MEM apache_malloc: 0x2e74af0: 72 bytes
[Fri Mar 19 18:01:06 2010] [notice] jrApache[1720: 12042] MEM apache_free: 0x2e74b70

Believe it or not a quick search of Google "jrApache apache_malloc" or "jrApache apache_free" show a big zero results (which is not common these days on Google).

We figured out after reading about malloc on Apache that it had to do with this setting in the JRunConfig in Apache:


JRunConfig Apialloc true

Apialloc has to do if the memory allocation is going to be handled by the Apache subsystem or the operating system.  Setting it to "true" tells Apache to handle it and setting it to "false" tells the module to ask the OS.  Setting apialloc to false solved the problem:


JRunConfig Apialloc false

We gleamed this information from Steven Erat's blog :


The JRun connector setting for Apialloc governs from where the connector allocates memory. The connector stub is written in C and when it needs to allocate memory it can either ask the operating system for memory (apialloc=false) or ask Apache for it (apialloc=true). Asking Apache for memory was probably quite safe in Apache 1.3x with just one instance of a JRun server, but its best to always set apialloc to false and let the stub work with the OS to manage memory.

via TalkingTree.com

I hope this blog entry filling the zero search results for Google and helps somebody else in the future.

No comments:

Post a Comment