Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
memory problem (Linux/malloc)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: John Max Skaller <skaller@o...>
Subject: memory problem (Linux/malloc)
Um.. sorry to ask a question not directly related to Ocaml..
I'm running Linux (Redhat 6.1) The following program
appears to leak:

#include <stdlib.h>

int main(int argc, char**argv)
  for(;;) {
    void *a = malloc(100);
    void *b = malloc(78);
    void *c = malloc(99);
    free(a); free(b); free(c);

I'm baffled. This shouldn't cause fragmentation, should it?
Does anyone know of a leak in this version of Linux/glibc/malloc?
[The leak is visible by running 'free']

John (Max) Skaller,
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper
download Interscript