What is a reasonable size for a Visual C ++ PDB file?

I am working on reducing the build time for a large Visual C ++ 2008 application. One of the worst bottlenecks is the PDB file generation: during the linking phase, mspdbsrv.exe quickly consumes the available RAM, and the collector starts to constantly go to the page.

My current theory is that our PDB files are simply too large. However, I could not find information on what the "normal" PDB file size is. I take some rough measurements of one of the DLLs in our application, as shown below:

  • CPP files: 34.5 MB, 900 thousand lines
  • Header files: 21 MB, 400 thousand lines
  • Compiled DLL: 33 MB (compiled for debugging, not release)
  • PDB: 187 MB

Thus, the PDB file is approximately 570% of the size of the DLL. Can anyone who has experience working with large Visual C ++ applications tell me if these relationships and sizes make sense? Or is there a sign that we are doing something wrong?

(The largest PDB file in our application is currently 271 MB, for a DLL 47.5 MB. However, the size of the source code is more difficult to measure for it.)

Thank!

+3
source share
2 answers

Yes, .pdb files can be very large - even the sizes you specify. Since the .pdb file contains data to map the source lines to machine code, and you compile a lot of code, there is a lot of data in the .pdb file, and you probably can't do anything about it.

, , - - DLL. DLL .pdb. , .

+1

? .

, , . .

0

Source: https://habr.com/ru/post/1771323/


All Articles