1

Valgrind shows Leak_DefinitelyLost inside libtensorflow.so. This is Valgrind message for simple session init:

- operator new(unsigned long) tensorflow::(anonymous   
   namespace)::PosixEnv::StartThread(tensorflow::ThreadOptions const&,  
   std::string const&, std::function<void ()>)
   tensorflow::thread::ThreadPool::ThreadPool(tensorflow::Env*, 
   tensorflow::ThreadOptions const&, std::string const&, int, bool)
   tensorflow::thread::ThreadPool::ThreadPool(tensorflow::Env*,    
   std::string const&, int)
   tensorflow::LocalDevice::EigenThreadPoolInfo::EigenThreadPoolInfo(tensor
   flow::SessionOptions const&)

   tensorflow::LocalDevice::LocalDevice(tensorflow::SessionOptions    
   const&, tensorflow::DeviceAttributes const&)   
   tensorflow::ThreadPoolDevice::ThreadPoolDevice(tensorflow::SessionOption
   s const&, std::string const&, 
   tensorflow::gtl::IntType<tensorflow::Bytes_tag_, long long>, 
   tensorflow::DeviceLocality const&, tensorflow::Allocator*)   
   tensorflow::ThreadPoolDeviceFactory::CreateDevices(tensorflow::SessionOptions
   const&, std::string const&, std::vector<tensorflow::Device*,
   std::allocator>*)
   tensorflow::DeviceFactory::AddDevices(tensorflow::SessionOptions
   const&, std::string const&, std::vector<tensorflow::Device*,
   std::allocator>*)
   tensorflow::DirectSessionFactory::NewSession(tensorflow::SessionOptions
   const&, tensorflow::Session**)
   tensorflow::NewSession(tensorflow::SessionOptions const&,
   tensorflow::Session**) TF_NewSession

The code caused this leak:

TF_Status* status = TF_NewStatus();
TF_Graph* graph = TF_NewGraph();
TF_SessionOptions* options = TF_NewSessionOptions();
TF_Session* sess = TF_NewSession(graph, options, status);
TF_DeleteSessionOptions(options);

TF_CloseSession(sess, status);
TF_DeleteSession(sess, status);


TF_DeleteGraph(graph); 
TF_DeleteStatus(status);

Please help understood if and how i can fix this. Additional this leak appears only if i link opencv if i disable opencv using leak dissapear

user10333
  • 331
  • 1
  • 9

0 Answers0