jeudi 28 mai 2015

Program Size keeps on Increasing.......c++11/Valgrind

I have not used new/delete massively in my program. just used when program start executing. After initial start-up, my program size keep on increasing. So, check what exactly is going on i try to run program with valgrind. It shows me definitely lost as 0, but possibly lost is too much.

==4594== LEAK SUMMARY:
==4594==    definitely lost: 0 bytes in 0 blocks
==4594==    indirectly lost: 0 bytes in 0 blocks
==4594==      possibly lost: 271,624 bytes in 2,858 blocks
==4594==    still reachable: 1,623,310 bytes in 9,797 blocks
==4594==         suppressed: 0 bytes in 0 blocks

If anyone say, it's not an issue.. then please understand it is a Issue because Finally program Size is growing. I tried to run program overnight but i am not getting memory back.

I suspect some of Issue pointed by Valgrind.

==4594== 32 bytes in 1 blocks are possibly lost in loss record 204 of 1,141
==4594==    at 0x4A075BC: operator new(unsigned long) (vg_replace_malloc.c:298)
==4594==    by 0x5812CA8: std::string::_Rep::_S_create(unsigned long, unsigned long, std::allocator<char> const&) (new_allocator.h:104)
==4594==    by 0x5812E67: std::string::_M_mutate(unsigned long, unsigned long, unsigned long) (basic_string.tcc:479)
==4594==    by 0x581340D: std::string::_M_replace_safe(unsigned long, unsigned long, char const*, unsigned long) (basic_string.tcc:684)
==4594==    by 0x45DCC8: ari::ReadLocalConfiguration(std::string&) (ARIApp.cpp:549)
==4594==    by 0x45EDEA: ari::ARIAppMain(int, char**) (ARIApp.cpp:694)
==4594==    by 0x45EC9B: main (ARIApp.cpp:677)

My Question is, why possibly lost of 32 bytes is indicated here, I have lots and lots of places where i am getting this sort of Issue?

Now one more extract from my Code, where i am using LOG4CXX.

==4594== 8,192 bytes in 1 blocks are possibly lost in loss record 1,119 of 1,141
==4594==    at 0x4A069EE: malloc (vg_replace_malloc.c:270)
==4594==    by 0x531E062: apr_pool_create_ex (in /usr/lib64/libapr-1.so.0.3.9)
==4594==    by 0x50582E7: log4cxx::helpers::Pool::Pool() (pool.cpp:34)
==4594==    by 0x505C793: log4cxx::PropertyConfigurator::parseAppender(log4cxx::helpers::Properties&, std::string const&) (propertyconfigurator.cpp:412)
==4594==    by 0x505DBB4: log4cxx::PropertyConfigurator::parseLogger(log4cxx::helpers::Properties&, log4cxx::helpers::ObjectPtrT<log4cxx::Logger>&, std::string const&, std::string const&, std::string const&) (propertyconfigurator.cpp:369)
==4594==    by 0x505EC17: log4cxx::PropertyConfigurator::configureRootLogger(log4cxx::helpers::Properties&, log4cxx::helpers::ObjectPtrT<log4cxx::spi::LoggerRepository>&) (propertyconfigurator.cpp:228)
==4594==    by 0x505F983: log4cxx::PropertyConfigurator::doConfigure(log4cxx::helpers::Properties&, log4cxx::helpers::ObjectPtrT<log4cxx::spi::LoggerRepository>&) (propertyconfigurator.cpp:168)
==4594==    by 0x505FF2F: log4cxx::PropertyConfigurator::doConfigure(log4cxx::File const&, log4cxx::helpers::ObjectPtrT<log4cxx::spi::LoggerRepository>&) (propertyconfigurator.cpp:109)
==4594==    by 0x506091C: PropertyWatchdog::doOnChange() (propertyconfigurator.cpp:67)
==4594==    by 0x502104A: log4cxx::helpers::FileWatchdog::checkAndConfigure() (filewatchdog.cpp:64)
==4594==    by 0x5021228: log4cxx::helpers::FileWatchdog::start() (filewatchdog.cpp:88)
==4594==    by 0x45EEA2: ari::ARIAppMain(int, char**) (ARIApp.cpp:701)

Somewhere i read that String Stored in read-only memory and memory will return back once program will exit. But in my case the program will go on months ... years.. without even restart. So it will crash after having memory crunch...

Please Suggest.

Thanks in Advance.

Aucun commentaire:

Enregistrer un commentaire