This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

16 bytes not freed on close


Sorry about the 32K message. I have included a small program to illustrate
the problem. 

#include <fstream.h>
extern "C" {
  extern unsigned _stklen;
  int _mstats(char * s);
}


main(int argc,char **argv)
{
  _mstats("Before open");
  {
    cerr << argv[1]  ;
    #ifdef WITH_OPEN
    fstream file(argv[1],ios::out);
  _mstats("Before close");
    file.close();
  _mstats("After close");
  file.open(argv[1],ios::out);
  _mstats("Before close");
    file.close();
  _mstats("After close");
  file.open(argv[1],ios::out);
  _mstats("Before close");
    file.close();
  _mstats("After close");
    #endif
    cerr << " is open\n";
  }
  _mstats("After close");
}

The resulting output:

Memory allocation statistics Before open
free:	 0 255 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 1 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4240, total free: 8048
emptyMemory allocation statistics Before close
free:	 0 254 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 2 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4256, total free: 8032
Memory allocation statistics After close
free:	 0 254 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 2 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4256, total free: 8032
Memory allocation statistics Before close
free:	 0 253 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 3 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4272, total free: 8016
Memory allocation statistics After close
free:	 0 253 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 3 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4272, total free: 8016
Memory allocation statistics Before close
free:	 0 252 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 4 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4288, total free: 8000
Memory allocation statistics After close
free:	 0 252 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 4 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4288, total free: 8000
 is open
Memory allocation statistics After close
free:	 0 252 124 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
used:	 0 4 4 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
	Total in use: 4288, total free: 8000

Normally I wouldn't be overly concerned except the program I am working on
performs approx. 7 million open and close operations. 

Steve Kachman
skachman@unl.edu

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]