how to release the virtual memory of pthread?
Hi all,
When i run my program, the virtual memory of that pthread is accumulatively increase. It was running well until the vmsize of that pthread reach the limit, roughly 2GB. How can i release the virtual memory of pthread? Thanks for any help. |
By fixing its memory leak.
|
Could you advise me how to fix it?
Thanks |
Please give some clues about what your program is.
What is it doing ? Did you wrote it yourself ? In what language is it written ? |
It is a simple program written in C language.
I just want to try this first before doing the project. May i know the sequence of a pthread process? is it pthread_create(), pthread_join(),pthread_detach(),pthread_cancel()? thanks |
Use valgrind to find out where the memory is leaking.
|
Thanks jlliagre
I tried it and run my program using valgrind --leak-check=yes myprogram after that definitely lost=0 possibly lost=0 and still reachable had some values. Is it mean that my program does not have memory leak? |
Likely, so the issue is probably your are allocating memory again and again, with keeping a reference to it.
You can use a heap profiler to figure out what is using this memory: http://valgrind.org/docs/manual/ms-manual.html |
All times are GMT -5. The time now is 12:21 PM. |