Women in Technology

Hear us Roar



Article:
  Knowing When to Let Go: Better Living Through Memory Management
Subject:   What about preallocated memory?
Date:   2003-06-11 16:59:28
From:   anonymous2
Response to: What about preallocated memory?

However it is also important to realise that malloc and free are not system calls. This is important because while brk/anon-mmap are relatively expensive, malloc and free are signifigantly cheaper. In most cases you are better off tuning your allocator then avoiding dynamic allocation.


There are problems that require pre-allocation, but they are few, and far between.

Full Threads Oldest First

Showing messages 1 through 1 of 1.

  • Re: What about preallocated memory?
    2003-06-11 22:01:17  iapole [View]

    Significantly cheaper, yes, but still expensive from some perspectives. A lot of my recent coding has been done with OpenGL, and I anticipate a point in the future where allocations will be the major bottleneck. It may be farther off than I think, of course, and I'll wait till then to optimize... but it's still a fun thing to know how to do!