Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
From: Pierre Monestie <pierre@chah.ucc.ie>
Subject: is free() lazy ?
Date: 1997/09/17	[thread overview]
Message-ID: <Pine.OSF.3.96.970917142107.1852B-100000@chah.ucc.ie> (raw)


Hi,
If in a c program I allocate a certain amount of memory 
and then I fred it, when I do a ps on my program I realize 
that the prog is taking (RSS value) the amount of memory 
I previously allocated. I know this memory is free but the
 system don't get it back. Is there a way (A kernel config?) to really
"free" this memory.
Nb : if i run my program on a linux pc, the memory is effectively freed.

I'm running DU40B.

void main(){
  int i;
  char *c;
  int sz=1000000;
/*Allocation*/
  c=(char*)malloc(sizeof(char)*sz);
/*Init*/
  for (i=0;i<sz;i++)
    c[i]='f';

  printf("Allocation done, enter a number\n");
  scanf("%d",&i);
  free(c);
  printf("free executed, enter a number\n");
  scanf("%d",&i);

}
thanks.
Pierre




             reply	other threads:[~1997-09-17  4:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-09-17  4:00 Pierre Monestie [this message]
1997-10-01  4:00 ` is free() lazy ? Al Simons
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox