Binaries build with -g option takes more memory?
In my application it looks like binaries which are build with debugging symbols (i.e g++ with -g option) taking more memory. My application is linked with lots of external third party libraries. All these third party libraries and my application are build with g++ -g option.
As my application run for long time (say 1 week) with load I see my application using big memory (high virt and RSS ). As per the memory detection tools (valgraind), my application has no memory leaks. All the memory leaks are reported in third party libraries. Here my question is will the binaries having debugging symbol increases the memory usage?. I understand there may be actual memory leaks in the application. But will binaries build with -g options adds more leak to this. I suspect this because binaries build with -g option may need additional space to keep track of allocate memory details. Also amount of starting memory require to load the binaries (build with -g)to memory will also be high. Thanks in advance. |
> will the binaries having debugging symbol increases the memory usage?.
Yes |
Quote:
Debug information is stored in the part of the executable files that never loaded in the RAM. When debugger need this info it take it from the file, not from the running process. The only parts of the executable that are loaded in the RAM are PT_LOAD segments. As simple test you can build same executable twice - with and without debug option and compare 'readelf -l your_executable' output. PT_LOAD segment should be same |
Thanks a lot
|
All times are GMT -5. The time now is 07:13 AM. |