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

about memory leak #1309

Open
kevincys opened this issue Dec 24, 2024 · 2 comments
Open

about memory leak #1309

kevincys opened this issue Dec 24, 2024 · 2 comments

Comments

@kevincys
Copy link

There seems to be too many memory leaks in your code. Do you know? Am I the only one who feels this? _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF); This occurs when you quit testing in debug mode in visual studio using . At first, I thought it was a false positive, but after looking at it one by one, it seems that the actual memory is not being released in many cases.

@paullouisageneau
Copy link
Owner

There seems to be too many memory leaks in your code. Do you know? Am I the only one who feels this?

Please be more specific, because it looks like you are the only one who "feels" this. FYI valgrind ./tests shows:

==1991454== HEAP SUMMARY:
==1991454==     in use at exit: 604,087 bytes in 7,810 blocks
==1991454==   total heap usage: 155,481 allocs, 147,671 frees, 23,231,36
0 bytes allocated
==1991454==
==1991454== LEAK SUMMARY:
==1991454==    definitely lost: 0 bytes in 0 blocks
==1991454==    indirectly lost: 0 bytes in 0 blocks
==1991454==      possibly lost: 0 bytes in 0 blocks
==1991454==    still reachable: 604,087 bytes in 7,810 blocks
==1991454==         suppressed: 0 bytes in 0 blocks

@kevincys
Copy link
Author

kevincys commented Jan 1, 2025

Thank you for your interest.
I am testing with Visual Studio 2022 vc++ on a Windows PC.

The first memory leak I encountered in Visual Studio Debug mode was rtc::InitLogger(LogLevel::Verbose); When I call , the plogInit(plog::Severity severity, plog::IAppender *appender) function is performed in global.cpp.

logger = new Logger(severity); and consoleAppender = new ConsoleAppender(); You can see .
However, I can't find where to delete it in the code, and Visual Studio shows that there is a memory leak.

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