Normally, you would do the initialize once per instance run. I am not sure if there is a function to check if it is already initialized and skip if not needed. I will check.

apr is threadsafe. The initialize is used to initialize memory for a specific run of the apr functions.

The atexit is based on a library safety suggestion from apache to make sure if the call terminates prematurely to force a clean of memory to remove a chance of a man in the middle attack gaining access to the heap used in hash creation.