CLASS="section" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" >

28.3. Improve performance Using GNU malloc library

If you're suffering from memory limitations on your system, the cache performance of Squid will be affected. To reduce this problem, you can link Squid with an external malloc library such as GNU malloc. To make Squid use GNU malloc as an external library, follows these simple steps:

These are the Package(s) required:

GNU malloc Homepage: http://www.gnu.org/order/ftp.html
You must be sure to download: malloc.tar.gz


                 [root@deep] /# cp malloc.tar.gz /var/tmp
                 [root@deep] /# cd /var/tmp
                 [root@deep ]/tmp# tar xzpf malloc.tar.gz
               

  1. Compile and install GNU malloc on your system by executing the following commands:
    
                   [root@deep ]/tmp# cd malloc
                       [root@deep ]/malloc# export CC=egcs
                       [root@deep ]/malloc# make
                     

  2. Copy the libmalloc.a file to your system library directory and be sure to name it libgnumalloc.a
    
                   [root@deep ]/malloc# cp libmalloc.a /usr/lib/libgnumalloc.a
                     

  3. Copy the malloc.h file to your system's include directory and be sure to name it gnumalloc.h
    
                   [root@deep ]/malloc# cp malloc.h /usr/include/gnumalloc.h
                     
    With the files libgnumalloc.a and gnumalloc.h installed on your system, Squid will detect them automatically during its compile time, and will use them to improve its cache performance.