Valgrind always has 5 blocks still reachable #1811
Unanswered
Keyun-Istil
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@Keyun-Istil is it the same amount of blocks an bytes all the time? I think we need to investigate where this comes from. Are you able to reproduce this with the leak sanitizer? This might give us some hints where to look. Leaked but still reachable would be something like this int main() {
auto foo = new int{42};
return *foo;
} Not nice but in general also not a big problem since the memory will be reclaimed by the OS when the process exits. Definite losses like the following would be problematic though void foo() {
for(int i = 0; i < 42; ++i) {
new int {i};
}
}
int main() {
foo();
foo();
return 0;
} Anyway, if you have the chance to check this with the leak sanitizer it would be quite helpful for us. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When I used Valgrind for memory checks I found that there were always five blocks of memory that were still reachable, and this would also be the case with the samples/icehello/iox-cpp-publisher-helloworld. Is there any good way to eliminate this?
LEAK SUMMARY:
definitely lost: 0 bytes in 0 blocks
indirectly lost: 0 bytes in 0 blocks
possibly lost: 0 bytes in 0 blocks
still reachable: 1,812 bytes in 5 blocks
suppressed: 0 bytes in 0 blocks
Beta Was this translation helpful? Give feedback.
All reactions