On Apr 12, 2010, at 9:51 AM, Noel O'Boyle wrote:
> There's a memory leak in readstring, at least when used with SMILES
> string, even with trunk. There is a filed bug -
> http://sourceforge.net/tracker/?func=detail&aid=2978796&group_id=40728&atid=428740.
I didn't think that was the problem because I didn't notice any
real growth when I was looking earlier. I see it now though. (One
issue is that the code caches 100,000 structures, which means leaks
are somewhat hidden.)
PID COMMAND %CPU TIME #TH #WQ #POR #MREG RPRVT RSHRD RSIZE
5302 Python 93.1 00:46.35 1/1 0 19 415 88M+ 1384K 93M+
... wait a while ...
5302 Python 90.1 01:58.91 1/1 0 19 418 92M 1384K 97M
... wait a while more ...
75302 Python 93.5 03:34.32 1/1 0 19 424 98M 1384K 103M
...
75302 Python 92.7 06:38.67 1/1 0 19 426 100M+ 1384K 105M+
I then ran your reproducible from that bug report
#include <openbabel/mol.h>
#include <openbabel/obconversion.h>
using namespace OpenBabel;
int main()
{
OBMol mol;
OBConversion conv;
conv.SetInFormat("smi");
for (int i=0; i<1000000; ++i)
conv.ReadString(&mol, "b...@h](I)F");
return 0;
}
g++ -I/usr/local/include/openbabel-2.0 nob.cpp -L/usr/local/lib -lopenbabel
./a.out
and there was a definite leak in that code.
75261 a.out 92.1 00:02.45 1/1 0 14 284+ 1952K+ 240K- 4844K+
75261 a.out 92.9 00:15.92 1/1 0 14 290+ 8224K+ 240K 11M+
75261 a.out 92.4 01:01.23 1/1 0 14 310 29M+ 240K 31M+
However, a memory leak by itself doesn't explain the segfaults.
I never get close to running out of memory.
Andrew
[email protected]
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
OpenBabel-Devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbabel-devel