Embedthis GoAhead 3.3.1
Home > Programmers Reference > Architecture

# Quick Nav

- Overview
- Enabling Allocator

# See Also

- User Guide Overview
- Authentication
- Ports and Binding
- Secure Sockets Layer

# Memory Allocator

## Overview

GoAhead provides an application-specific memory allocator to use instead of malloc. This allocator is useful when the native operating system malloc suffers from excessive fragmentation. It is faster than most general purpose malloc allocators for the GoAhead web server workload. It is deterministic and allocates and frees memory in constant time O(1).

The allocator is optimized for frequent allocations of small blocks (< 4K). It uses a scheme of buddy free queues for fast allocation. Memory allocations are aligned on 16 byte boundaries on 64-bit systems and otherwise on 8 byte boundaries. It will not return chunks of unused memory back to the O/S.

### Enabling the Allocator

The allocator is not enabled by default as most operating systems now have suitable malloc implementations. To enable, run configure and rebuild:

    configure --set replaceMalloc=true
    bit

© Embedthis Software LLC, 2003-2014. All rights reserved. Embedthis and Embedthis GoAhead are trademarks of Embedthis Software LLC.