valgrind

Android: tools to find memory leaks? [closed]

北战南征 提交于 2019-12-18 12:38:44
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Are there some useful tools to detect memory leaks in Android Java applications? Something similar to Valgrind where the place of creation of a non-freed object is shown? 回答1: Watch this: http://www.youtube.com/watch?v=_CruQY55HOk Then install MAT for Eclipse. Happy hounting! 回答2: read this post on Android

How use callgrind to profiling only a certain period of program execution?

廉价感情. 提交于 2019-12-18 11:45:43
问题 I want to use valgrind to do some profiling, since it does not need re-build the program. (the program I want to profile is already build with “-g") But valgrind(callgrind) is quite slow ... so here's what I to do: start the server ( I want to profile that server) kind of attach to that server before I do some operation on server, start collect profile data after the operation is done, end collecting profile data analyze the profiling data. I can do this kind of thing using sun studio on

Coding a getline() implementation - Valgrind errors

对着背影说爱祢 提交于 2019-12-18 09:42:05
问题 I have to recode an implementation of the getline() function, but using the file descriptor of the file and not a FILE * . I am only allowed to use malloc() and free() , along with 5 functions being 25 lines long at most. I think I've done correctly the project although I am a beginner in C and my code isn't probably good. When I run it, it works fine, but valgrind shows that I definetely lost x bytes , x depending of the file length and the READ_SIZE (macro defined in the header). According

Is there a bug in the boost asio HTTP Server 3 example or boost bug?

风流意气都作罢 提交于 2019-12-18 09:11:15
问题 boost library version 1.53 Debian Linux 6.0 ( Linux 2.6.32-5-amd64 on x86_64 ) It is hard to test own software when valgrind log contains lots of warnings. So with no changes I built the HTTP server3 example and run it under the Valgrind. Take a look, please. Did I miss something? valgrind --tool=helgrind --log-file=valgrind.log ./server3 0.0.0.0 83 5 /root/server3 Here is the Helgrind log (edited to 30000 body characters limit, full log http://pastebin.com/Vkbr9vsA): Helgrind, a thread error

Is it up to the programmer to deallocate on exit()?

我只是一个虾纸丫 提交于 2019-12-18 09:03:11
问题 I have a program and when I input wrong data from the keyboard it just exits with exit(1) . I was testing with Valgrind and while this happens there are no errors, but I can see that there are still reachable x bytes. So my question: Is it up to the programmer to free memory before hitting an exit() or is the OS going to take care of it? 回答1: It's a good idea (and in old enough versions of Windows, it was essential), but when a program exit() s on modern operating systems its entire address

alsa - mem leak?

半腔热情 提交于 2019-12-18 06:49:11
问题 I've been chasing a memory leak (reported by 'valgrind --leak-check=yes') and it appears to be coming from ALSA. This code has been in the free world for some time so I'm guessing that it's something I'm doing wrong. #include <stdio.h> #include <stdlib.h> #include <alsa/asoundlib.h> int main (int argc, char *argv[]) { snd_ctl_t *handle; int err = snd_ctl_open( &handle, "hw:1", 0 ); printf( "snd_ctl_open: %d\n", err ); err = snd_ctl_close(handle); printf( "snd_ctl_close: %d\n", err ); } The

Having hard time tracking memory corruption - when running with Valgrind runs correctly with no errors

天大地大妈咪最大 提交于 2019-12-18 05:02:52
问题 We have a complex program that is working well on heavy duty input (any input actually) with no multithreading implemented. We've implemented multithreading with a threadpool, and given these input parameters I get these results: ( Note : Where I say no errors , it means I've tested with valgrind -v and when I say no memory leaks , it means I've tested it with valgrind --leak-check=full -v ). small_file: Runs successfully with more than 1 workers (threads), no valgrind errors, no memory leaks

Memory not freed but still reachable, is it leaking?

只愿长相守 提交于 2019-12-17 23:38:30
问题 By checking with valgrind, I see that 5 blocks of memory were not freed after terminating my program, but they are still reachable. Do I need to be bothered by it? And how it happens? zhanwu@gelata:~/sandbox$ valgrind ./a.out ==2430== Memcheck, a memory error detector ==2430== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al. ==2430== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info ==2430== Command: ./a.out ==2430== Hello world! Thread1 returns 1 Thread2

What tools do you use to develop C++ applications on Linux? [closed]

↘锁芯ラ 提交于 2019-12-17 22:28:55
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . I develop C++ applications in a Linux environment. The tools I use every day include Eclipse with the CDT plugin, gdb and valgrind.

does openmp allocate memory and free all after

半腔热情 提交于 2019-12-17 20:27:23
问题 Does openmp allocate memory and free all memory? Because I ran valgrind, and did free all my lists.. Everything that I malloc, did I free. ==11442== HEAP SUMMARY: ==11442== in use at exit: 192 bytes in 1 blocks ==11442== total heap usage: 2,001 allocs, 2,000 frees, 2,917,280 bytes allocated ==11442== ==11442== LEAK SUMMARY: ==11442== definitely lost: 0 bytes in 0 blocks ==11442== indirectly lost: 0 bytes in 0 blocks ==11442== possibly lost: 0 bytes in 0 blocks ==11442== still reachable: 192