21y4d/nmapAutomator

High CPU usage

Closed this issue · 1 comments

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

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.