How to free memory of CreatorRegistry?

30 views
Skip to first unread message

MrLoverLover3.0

unread,
Feb 15, 2016, 5:26:48 AM2/15/16
to Caffe Users
Hello,
I have a question regarding the class LayerRegistry resp. CreatorRegistry. I am using the macro REGISTER_LAYER_CLASS for registering the layers. I have looked at the source code of layer_factory.hpp and I have noticed the static pointer g_registry_.

static CreatorRegistry* g_registry_ = new CreatorRegistry();

I understand why a static pointer is used here, yet the reserved memory is never freed! (Visual Studio also reports some memory leaks)
Of course I know that the OS will clean up the memory when the process terminates but I am writing a library. If the library is loaded and unloaded multiple times by a single process, the memory leak is noticeable.
How could I free the memory without modifying the caffe code?




Reply all
Reply to author
Forward
0 new messages