facebook / infer

A static analyzer for Java, C, C++, and Objective-C
http://fbinfer.com/
MIT License
14.8k stars 2k forks source link

Stuck when analyzing big projects written in c and c++ #1767

Open nibienaohehe opened 1 year ago

nibienaohehe commented 1 year ago

image

shankkyy commented 1 year ago

hey @nibienaohehe please may I know more about this issue

nibienaohehe commented 1 year ago

hey @nibienaohehe please may I know more about this issue

I was analyzing the AOSP project and the input is a compile_commands.json file. I found it took really long time when analyzing some files in the "external" directory, and the analysis was failed because of out of memory. The RAM is 32G, the swap was set as 160G, the number of threads was set as 16, and only the "Pulse" checker was turned on.

shankkyy commented 9 months ago

first of all thank you soo much @nibienaohehe for explaining me more about the issue I got some hands on points for you regarding this issue Having a large swap space (160GB) can help prevent OOM errors, but it's important to ensure that the swap is properly configured and efficient. Make sure that your swap space is on a fast storage device (e.g., SSD) for better performance so here you can optimize swap and may be you can increase the memory as you mentioned you have 32G analyzing large projects may still require more memory Increasing the number of threads (you mentioned 16 threads) can help speed up the analysis, but it can also increase memory usage. Be cautious with this setting, and monitor resource usage to avoid OOM errors(running out of memory).