[Ace-users] [ace-users] ACE_Stream beginner problem

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Mon Jan 14 19:32:20 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 ?

I recommend that you run Valgrind to find out what's going on here.

Thanks,

        Doug
-- 
Dr. Douglas C. Schmidt                       Professor and Associate Chair
Electrical Engineering and Computer Science  TEL: (615) 343-8197
Vanderbilt University                        WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203                          NET: d.schmidt at vanderbilt.edu



More information about the Ace-users mailing list