[Ace-users] ACE_Stream beginner problem

rt taglioretti at yahoo.com
Mon Jan 14 18:02:59 CST 2008


Hi,
I'm a ACE beginner, this is my source code:

#include "ace/Stream.h"

int
ACE_TMAIN(int argc, ACE_TCHAR *argv[])
{
  ACE_UNUSED_ARG(argc);
  ACE_UNUSED_ARG(argv);

  for(int test=0; test < 10000; test++) {
    ACE_DEBUG((LM_DEBUG, "(%P|%t)
---------------------------------------- start test %d\n",test ));
    ACE_Stream<ACE_MT_SYNCH> *stream;
    stream = new ACE_Stream<ACE_MT_SYNCH>();
    if(stream != NULL) {
      int retVal = stream->open(NULL);
      ACE_DEBUG((LM_DEBUG, "(%P|%t) stream->open(NULL) retVal == %d
\n",retVal ));
      retVal = stream->close();
      ACE_DEBUG((LM_DEBUG, "(%P|%t) stream->close() retVal == %d
\n",retVal ));
      delete stream;
    }
    ACE_DEBUG((LM_DEBUG, "(%P|%t)
----------------------------------------  end test %d\n",test ));
    getchar();
  }

  return 0;
}

The ACE library version is 5.6 and the plattform Linux kernel 2.4.30
ow1 gcc 3.2.3
After 2 step I can see that the memory is not totally release:
step 1 used 1872
step 2 used 1884
step 3 used 1896
.......
step 800 used 9200
and so on.....

Someone could help me understand where is the problem ?

Thanks

Roberto




More information about the Ace-users mailing list