Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in vtkPlusConfig::GetInstance() #1070

Open
kenavolic opened this issue Mar 22, 2023 · 2 comments
Open

Memory leak in vtkPlusConfig::GetInstance() #1070

kenavolic opened this issue Mar 22, 2023 · 2 comments

Comments

@kenavolic
Copy link
Contributor

Cause

Loop caused by vtkPlusConfig::GetInstance() calling vtkPlusLogger::Instance() calling vtkPlusConfig::GetInstance()

Memory leak description

==196447== 3,097 (352 direct, 2,745 indirect) bytes in 1 blocks are definitely lost in loss record 12 of 12
==196447==    at 0x4844E63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==196447==    by 0x4A0F6DD: vtkPlusConfig::GetInstance() (vtkPlusConfig.cxx:95)
==196447==    by 0x4A23D66: vtkPlusLogger::Instance() (vtkPlusLogger.cxx:44)
==196447==    by 0x4A0F8EA: vtkPlusConfig::vtkPlusConfig() (vtkPlusConfig.cxx:131)
==196447==    by 0x4A0F6E8: vtkPlusConfig::GetInstance() (vtkPlusConfig.cxx:95)

Calls sequence

  • vtkPlusConfig::GetInstance()
    • new vtkPlusConfig() (vtkPlusConfig.cxx:95)
      • logger creation in vtkPlusConfig ctor (vtkPlusConfig.cxx:131)
        • call to vtkPlusConfig::GetInstance() after logger instance creation (vtkPlusLogger.cxx:44)
          • new vtkPlusConfig() (vtkPlusConfig.cxx:95) -> the loop stops here because logger instance is created
@adamrankin
Copy link
Member

@Sunderlandkyl The circular dependency was added in #493, maybe there's another solution

@adamrankin
Copy link
Member

adamrankin commented Nov 20, 2023

Could we remove the logging from vtkIGISOAccurateTimer::GetInstance?

Edit: Nevermind, wrong project for define

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants