memory.html 1.3 KB

1234567891011121314151617181920212223
  1. {
  2. title: "Memory Allocation",
  3. crumbs: [
  4. { 'Reference Guide': '../ref/' },
  5. ],
  6. }
  7. <h1>Memory Allocator</h1>
  8. <a id="overview"></a>
  9. <h2>Overview</h2>
  10. <p>GoAhead provides an application-specific memory allocator to use instead of malloc. This allocator is
  11. useful when the native operating system malloc suffers from excessive fragmentation.
  12. It is faster than most general purpose malloc allocators for the GoAhead web server workload. It is
  13. deterministic and allocates and frees memory in constant time O(1). </p>
  14. <p>The allocator is optimized for frequent allocations of small blocks (&lt; 4K). It
  15. uses a scheme of buddy free queues for fast allocation. Memory allocations are aligned on 16 byte boundaries on
  16. 64-bit systems and otherwise on 8 byte boundaries. It will not return chunks of unused memory back to the O/S.</p>
  17. <a id="enabling"></a>
  18. <h3>Enabling the Allocator</h3>
  19. <p>The allocator is not enabled by default as most operating systems now have suitable malloc implementations.
  20. To enable, run configure and rebuild:</p>
  21. <pre class="ui code segment">configure --set replaceMalloc=true
  22. me
  23. </pre>