From: Eric F. <efe...@ph...> - 2009-02-10 14:40:05
|
> -----Original Message----- > From: Rainer Machne [mailto:ra...@tb...] > Sent: 06 February 2009 09:16 > To: Eric Fernandez > Subject: RE: [SOSlib-discuss] memory exhaustion creating > odeModels[Scanned] > > > Maybe you can update to a later release or SVN version of > libSBML, I remember at least one memory leak in ASTNode in > the first 3.x.x versions. > Rainer Hi, My mistake, it seems the memory run-out occurs when creating odeModel_t*: This does work: int main() { int ctit; string modelFilename = "../../models/CC.xml"; SBMLDocument_t *d; Model_t *m; d = readSBML(modelFilename.c_str()); m = SBMLDocument_getModel(d); for(ctit = 0; ctit != 10000; ++ctit) { m = SBMLDocument_getModel(d); //DOES NOT EXHAUST!! } } but this segfaults after only 114 created instances of odeModels: int main() { int ctit; string modelFilename = "../../models/CC.xml"; SBMLDocument_t *d; Model_t *m; d = readSBML(modelFilename.c_str()); m = SBMLDocument_getModel(d); for(ctit = 0; ctit != 10000; ++ctit) { m = SBMLDocument_getModel(d); //DOES NOT EXHAUST!! odeModel_t* om = ODEModel_create(m); //SEGFAULT!! } } Is an odeModel structure that big, or is there a possible memleak ? Eric |