The Harmonious Programmer

The Harmonious Programmer

Covering a symphony of technical and sometimes off-topic subjects

  • Home
  • JRun / Apache / jrApache Malloc Errors

    • 19 Mar 2010
    • 0 Responses
    •  views
    • Apache CFML JRun
    • Edit
    • Delete
    • Tags
    • Autopost

    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.

    • Tweet
  • How to Apply the Apache 2.0 License to Your Project

    • 18 Nov 2009
    • 1 Response
    •  views
    • Apache Open Source
    • Edit
    • Delete
    • Tags
    • Autopost
    Every once is a while I get asked the questions about open source licenses.  Here is a simple tutorial on how to apply the Apache 2.0 License to your project.

    1. First you'll need a copy of the Apache 2.0 License for your project. Grab a copy by downloading in text form from the Apache Software Foundation.
    2. Now, you need to modify a notice statement so you can add them to your files. We'll get to where you put the notice statement in step 3 so just hold your horses for a moment. Here is boilerplate notice which you will modify for your project:

       Copyright [yyyy] [name of copyright owner]

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
       limitations under the License.


    Some things you must do:

    a) Replace all [bracketed] items in the above notice statement. There are only two of these items so should not be hard for you to do.
    b) Do not leave the brackets in the notice. For example, "[yyyy]" would be replaced with "2009" (or what ever year you release in). Again, do not leave the brackets in the notice statement.

    3. Apply the your notice statement to each and every file in which the Apache License applies. The most common mistake when applying the license that people think that supplying the license text is enough to make your the project licensed under the Apache License.  Again, you must place a copy of the notice statement (probably at the top) in the appropriate "comment syntax" for the file format.

    4. Secondly, you need two files in the root or top directory of your distribution.  It's best to not deeply nest them in a some directory deep in your project.  Leave them in the root or top directory. One file should be named LICENSE (no file extension) in which you will place the text from the license you just downloaded in step 1. The other file that is required is a file named NOTICE in which you place a copy of your notice statement you modified above and a listing of the names of licensed libraries used in your project (be sure to list the names of the developers of those projects as well -- show your appreciation).

    5. If use other code in your project that is licensed under a different license, I must make sure those libraries are compatible with the Apache 2.0 License.  For example, GPL version 2.0 is not compatible with the Apache 2.0 license. Also, you must leave any original copyright and patent notices in the code you redistribute.  It is important that you preserve this notifications and you must explicitly sate if you made changes to that file.

    Presto! You're done!  The depending on the size of the project, adding the notice statement to each file will take you the most time.  I'd recommend against using a SVN keyword or other placeholder to dynamically insert the notice statement at build time because your notice would not be present when browsing code through a source code repository (such as SVN or CVS).

    • Tweet
  • About

    Hailing from the frigid tundra of Minnesota, Peter J. Farrell has a Bachelor of Music degree from the Peabody Institute at the Johns Hopkins University in Baltimore, Maryland.

    While studying music, Peter took his life-long interest with computers to a new level and started learning about web development technologies. He has been working with CFML since 2001 and is the lead developer of the Mach-II framework.

    Peter is a Senior Technologist for GreatBizTools, a human resources consulting firm. He and his wife, Allyson, live together in Minneapolis, Minnesota.

    326619 Views
  • Archive

    • 2012 (4)
      • January (4)
    • 2011 (10)
      • August (1)
      • May (4)
      • April (3)
      • March (1)
      • February (1)
    • 2010 (58)
      • December (1)
      • November (1)
      • October (1)
      • September (3)
      • August (4)
      • July (1)
      • June (4)
      • May (12)
      • April (15)
      • March (3)
      • February (5)
      • January (8)
    • 2009 (38)
      • December (14)
      • November (22)
      • October (2)

    Get Updates

    Subscribe via RSS
    TwitterFacebookLaconi.ca/Identi.caLinkedInFlickr
  • Resources

    • Lyla Captcha for CFML
    • Rooibos Bean Generator
    • Mach-II Framework for CFML
    • Presentations