English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2000-12-18 (14:49)
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, mailto:skaller@maxtal.com.au
10/1 Toxteth Rd Glebe NSW 2037 Australia voice: 61-2-9660-0850
checkout Vyper http://Vyper.sourceforge.net
download Interscript http://Interscript.sourceforge.net