Thread: [Quickfix-users] Memory Leak
Brought to you by:
orenmnero
From: Monheit, D. <Dav...@ci...> - 2006-09-29 11:44:10
|
Well. After spending some more time with Purify and valgrind, I am starting to think that there is not an actual leak, but more of a "hoarding" of memory !!! There is no question that the program grows and grows (as per the previous posting) but now I am not convinced that it is because of a leak. Oren, what do you reckon is the normal memory foot print of a simple quickfix app which just return from fromApp without doing anything? Why when I just instantiate a message from a string, over and over again, the footprint is stable. When I start using the copy constructor the foot print grows even though the program is not really doing anything? What is it about repeating groups that could induce this observations? Both valgrind and purify don't detect any significant leak (when compared to the footprint) when one calls initiator.stop() and then exit(). I am puzzled and frustrated :-) Regards David ------------------------------------------------------- David Monheit Citadel Investment Group (Europe) Ltd Tel +44 (0) 20 7645 9715 Mob +44 (0) 7968 988 218 ------------------------------------------------------------------------ ------------------------------------------------------------------------ -- The contents of this message and any attachments may be privileged, confidential and proprietary. If you are not an intended recipient, please inform the sender of the transmission error and delete this message immediately without reading, disseminating, distributing or copying the contents. Citadel makes no assurances that this e-mail and any attachments are free of viruses and other harmful code. Citadel Investment Group (Europe) Ltd is authorized and regulated by the Financial Services Authority (FSA Firm Ref No 190260). Registered in England and Wales. Registration No. 3666898. Registered Office: 10th Floor, 2 George Yard, Lombard Street, London EC3V 9DH. |
From: Oren M. <or...@qu...> - 2006-09-29 22:49:11
|
David, Can you provide some more information about your environment? Are =20 you running under unix or windows. If you are running under unix I =20 have a theory about what you might be experiencing. --oren On Sep 29, 2006, at 6:44 AM, Monheit, David wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/=20 > html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > Well. After spending some more time with Purify and valgrind, I am =20= > starting to think that there is not an actual leak, but more of a =20 > =93hoarding=94 of memory !!! > > > > There is no question that the program grows and grows (as per the =20 > previous posting) but now I am not convinced that it is because of =20= > a leak. > > > > Oren, what do you reckon is the normal memory foot print of a =20 > simple quickfix app which just return from fromApp without doing =20 > anything? Why when I just instantiate a message from a string, =20 > over and over again, the footprint is stable. When I start using =20 > the copy constructor the foot print grows even though the program =20 > is not really doing anything? What is it about repeating groups =20 > that could induce this observations? > > > > Both valgrind and purify don=92t detect any significant leak (when =20 > compared to the footprint) when one calls initiator.stop() and then =20= > exit()=85 > > > > I am puzzled and frustrated J > > > > Regards > > David > > > > > > ------------------------------------------------------- > > David Monheit > > Citadel Investment Group (Europe) Ltd > > Tel +44 (0) 20 7645 9715 > > Mob +44 (0) 7968 988 218 > > > > > ----------------------------------------------------------------------=20= > ----------------------------------------------------------------------=20= > ------ > > The contents of this message and any attachments may be privileged, =20= > confidential and proprietary. If you are not an intended recipient, =20= > please inform the sender of the transmission error and delete this =20 > message immediately without reading, disseminating, distributing or =20= > copying the contents. Citadel makes no assurances that this e-mail =20 > and any attachments are free of viruses and other harmful code. > > Citadel Investment Group (Europe) Ltd is authorized and regulated =20 > by the Financial Services Authority (FSA Firm Ref No 190260). > Registered in England and Wales. Registration No. 3666898. > Registered Office: 10th Floor, 2 George Yard, Lombard Street, =20 > London EC3V 9DH. > ----------------------------------------------------------------------=20= > --- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to =20 > share your > opinions on IT & business topics through brief surveys -- and earn =20 > cash > http://www.techsay.com/default.php?=20 > page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV____________________________= ____=20 > _______________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users |
From: Oren M. <or...@qu...> - 2006-09-30 08:29:13
|
I looked into this further and the results are truly bizarre. I was able to duplicate the first 'leak' that you demonstrated (which =20= as you point out isn't really a leak at all). The thing is there =20 isn't really anything that is hoarding memory either. The testing I was doing was with gcc 4.0.1. I ran a simple test that =20= sent message from one session to another with an empty fromApp. I =20 was using a SocketInitiator/SocketAcceptor pair. As expected, the =20 memory footprint remained constant. I then added your example of =20 creating a new message with the copy constructor. In this case, the =20 memory footprint was definitely increasing, like you predicted it =20 would. Here is where it begins to get weird. I switched to using a ThreadedSocketInitiator/ThreadedSocketAcceptor =20 pair, and poof, the memory footprint remained constant even with the =20 copy constructor calls. So we have a situation where the exact same code increases the =20 footprint in one case, but not in the other. And since there is no =20 increase in footprint with an empty fromApp with both acceptor types, =20= there isn't a reason they should behave differently. So, on a hunch I compiled QuickFIX with icc and reran the tests. =20 Well, you can guess what happened here, no increase of the memory =20 footprint under any scenario. Yikes! Looks like a compiler bug! I don't know the details of your environment, but are you using a =20 SocketInitiator or Acceptor, and if so, can you try switching to the =20 Threaded versions and see how this affects the footprint? --oren > Well. After spending some more time with Purify and valgrind, I am =20= > starting to think that there is not an actual leak, but more of a =20 > =93hoarding=94 of memory !!! > > There is no question that the program grows and grows (as per the =20 > previous posting) but now I am not convinced that it is because of =20= > a leak. > > Oren, what do you reckon is the normal memory foot print of a =20 > simple quickfix app which just return from fromApp without doing =20 > anything? Why when I just instantiate a message from a string, =20 > over and over again, the footprint is stable. When I start using =20 > the copy constructor the foot print grows even though the program =20 > is not really doing anything? What is it about repeating groups =20 > that could induce this observations? > > Both valgrind and purify don=92t detect any significant leak (when =20 > compared to the footprint) when one calls initiator.stop() and then =20= > exit()=85 > > I am puzzled and frustrated J > > Regards > > David |