This discussion is archived
3 Replies Latest reply: Nov 20, 2012 7:50 AM by Lucas Vogel RSS

Memory leak in query preparation in dbxml-2.3.10

955652 Newbie
Currently Being Moderated
Hi,
We are using dbxml-2.3.10 in our production. I have ran valgrind and see big memory leaks under two categories:

Definetly lost:
The complete stack trace is as below:
==25482== 13,932 bytes in 129 blocks are definitely lost in loss record 32 of 35
2547 ==25482== at 0x4004790: operator new(unsigned) (vg_replace_malloc.c:164)
2548 ==25482== by 0x4144131: XQSort::SortSpec::staticResolution(StaticContext*, StaticResolutionContext&) (in /usr/netscreen/GuiSvr/utils /dbxml-2.3.10/lib/libxqilla.so.1.0.0)
2549 ==25482== by 0x4144BEC: XQSort::staticResolution(StaticContext*, StaticResolutionContext&) (in /usr/netscreen/GuiSvr/utils/dbxml-2.3 .10/lib/libxqilla.so.1.0.0)
2550 ==25482== by 0x4145A2A: XQFLWOR::staticResolutionImpl(StaticContext*) (in /usr/netscreen/GuiSvr/utils/dbxml-2.3.10/lib/libxqilla.so. 1.0.0)
2551 ==25482== by 0x4146018: XQFLWOR::staticResolution(StaticContext*) (in /usr/netscreen/GuiSvr/utils/dbxml-2.3.10/lib/libxqilla.so.1.0. 0)
2552 ==25482== by 0x41780CC: XQQuery::staticResolution(StaticContext*) (in /usr/netscreen/GuiSvr/utils/dbxml-2.3.10/lib/libxqilla.so.1.0. 0)
2553 ==25482== by 0x4563D6E: DbXml::StaticResolver::optimize(XQQuery*) (Optimizer.cpp:64)
2554 ==25482== by 0x4563C42: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:42)
2555 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2556 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2557 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2558 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2559 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2560 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2561 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2562 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2563 ==25482== by 0x4563C5B: DbXml::Optimizer::startOptimize(XQQuery*) (Optimizer.cpp:39)
2564 ==25482== by 0x4446CE9: DbXml::QueryExpression::QueryExpression(std::string const&, DbXml::XmlQueryContext&, DbXml::Transaction*) (S copedPtr.hpp:41)
2565 ==25482== by 0x44A3F63: DbXml::XmlManager::prepare(std::string const&, DbXml::XmlQueryContext&) (XmlManager.cpp:601)
2566 ==25482== by 0x82B3152: XQuery::prepare(unsigned, unsigned short, char const*, char const*, char const*, char const*, char const*, R efCountedAutoPtr<XdbQueryContext>, unsigned) (XQuery.cpp:152)

We see another huge leak in possiibly lost category:

371,895 bytes in 121 blocks are possibly lost in loss record 33 of 35
2570 ==25482== at 0x4004405: malloc (vg_replace_malloc.c:149)
2571 ==25482== by 0x818C330: malloc (guiDaemon.c:783)
2572 ==25482== by 0x44A5B0C: DbXml::SimpleMemoryManager::allocate(unsigned) (Globals.cpp:67)
2573 ==25482== by 0x497CCFC: xercesc_2_7::XMemory::operator new(unsigned, xercesc_2_7::MemoryManager*) (in /usr/netscreen/GuiSvr/utils/db xml-2.3.10/lib/libxerces-c.so.27.0)
2574 ==25482== by 0x48D681A: xercesc_2_7::XMLPlatformUtils::makeMutex(xercesc_2_7::MemoryManager*) (in /usr/netscreen/GuiSvr/utils/dbxml- 2.3.10/lib/libxerces-c.so.27.0)
2575 ==25482== by 0x44A61B6: DbXml::Globals::initialize(DbEnv*) (Globals.cpp:78)
2576 ==25482== by 0x44A766C: DbXml::Manager::initialize(DbEnv*) (Manager.cpp:167)
2577 ==25482== by 0x44A8CBB: DbXml::Manager::Manager(DbEnv*, unsigned) (Manager.cpp:98)
2578 ==25482== by 0x44A2EAD: DbXml::XmlManager::XmlManager(DbEnv*, unsigned) (XmlManager.cpp:58)
2579 ==25482== by 0x83398EA: XdbImpl::initDb(bool, int) (XdbImpl.cpp:478)
2580 ==25482== by 0x8337407: XdbImpl::start(char const*, int) (XdbImpl.cpp:159)
2581 ==25482== by 0x8321123: Xdb::start(char const*, int) (Xdb.cpp:56)

Are these leaks addressed in some 2.3.10 patch? Please suggest way to solve the same.

PS : We are trying to upgrade to 2.5.16 but there are certain issues already reported in another thread due to which we are not able to migrate.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points