Usenet comp.unix.osf.osf1 (1992-2004)
 help / color / mirror / Atom feed
* is free() lazy ?
@ 1997-09-17  4:00 Pierre Monestie
  1997-10-01  4:00 ` Al Simons
  0 siblings, 1 reply; 2+ messages in thread
From: Pierre Monestie @ 1997-09-17  4:00 UTC (permalink / 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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1997-10-01  4:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1997-09-17  4:00 is free() lazy ? Pierre Monestie
1997-10-01  4:00 ` Al Simons

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