21y4d / nmapAutomator

A script that you can run in the background!
MIT License
2.67k stars 790 forks source link

High CPU usage #36

Closed 11nf0s3c closed 3 years ago

11nf0s3c commented 3 years ago

Been using nmapAutomator for a while, a wonderful script with good scanning results. Recently updated with the recent version noticed very high CPU usage. The full scan is kicking the laptop fan and the CPU usage goes up to 60% which was not the case with the old nmapAutomator script.

I have checked the process a few times with a few different hosts. Also ran the old script and the CPU usage stays in between 10% - 15%. My laptop is a few years old with an i7 8th gen processor, 16 GB ram.

21y4d commented 3 years ago

Thanks for reporting this. I noticed this during testing, but thought it was due something else.

It turns out the while loop that check for the nmap progress bar was running out of control XD The script now limits the number of checks to update the progress bar, for shorter scans it'll check 2 times a second, and for longer scans once every 3 seconds..

The script seems to run efficiently now, and fixed the high CPU issue.