>Without seeing real code, I can't say for sure, but I suspect with STL,
you're incurring a lot of extra memory overhead in not reserving/resizing
vectors to the size you want. (Actually, I see you posted to
openbabel-discuss with this: http://pastebin.com/HHy149fZ

I posted a corrected version of the source code on this page
http://pastebin.com/w24HFsJA
After pre-allocating the space, memory still get consumed very very quickly
(when allocating the container space with empty molecules, there is about
100MB that gets allocated)

>My suggestion would be to monitor the memory usage, e.g.: for the vector 
sizeof(v) + sizeof(T) * v.capacity(); // where T is the element type 

Do you mean do a sizeof( OBMol)?

>I'd be happy to help work with you to find your issues. I think the first
one is to try to reserve space in the vector before push_back a few hundred
(or thousand) times. 

Thanks I really appreciate your help.

-Andi

--
View this message in context: 
http://forums.openbabel.org/Memory-Leak-or-Usage-tp3409445p3416941.html
Sent from the openbabel-devel mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
OpenBabel-Devel mailing list
OpenBabel-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbabel-devel

Reply via email to