-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory Usage is too high when using Progress(...) #117
Comments
I don't think the gigabyte of used RAM is due to the task progress slice, or to the output kept in memory. The nmap outputs amounts to maybe a few megabytes on a very large scan, and 10 minutes of progress reports every 100ms would mean 6000 structs that are each a few bytes, so likely only takes a few kilobytes. The ram usage most likely comes from the dependencies of this library and Go's policy for garbage collection. 1GB usage doesn't necessarily mean that the program is using 1GB right now, it only means that it reserved 1GB (probably because the total allocations amount to 1GB) but if the system tries to get some of that memory back, the garbage collector will free what's not in use. I could do a proper benchmark if this becomes a real issue, but so far from my testing the consumption seems to be nothing out of the ordinary. |
Thanks for the feedback! When removing the About the Go's policy for garbage collection: the issue occurred in a container / Kubernetes environment with a memory request and limit set to 1GB. During multiple runs, the container was OOMKilled, which means that the real memory used was above 1GB. I'll try to use the |
Ah, that is interesting 🤔 There is then indeed an issue with the progress mode. We need to look into it! Will update the labels accordingly. |
TODO, in case someone else picks it up:
|
This looks like a serious issue indeed. Thanks for the details! I'll try to find some time to fix this. |
@Ullaakut hello, Are SIGUSR1 and SIGUSR2 signals used in this project? |
@llwq123456 No |
https://github.com/Ullaakut/nmap/releases/tag/v3.0.4 seems to have fixed the issue! Thanks 🔥 |
When running nmap with service info and progression, the memory usage is above 1GB in around 10 minutes. Which seems quite high.
I see multiple way to reduce the memory usage:
ToFile
function to store the nmap XML result to a file, as suggested in Fix run with progress and add new Run function #69. However, this makes the Progress value to always be 0.nmap/nmap.go
Line 77 in a750324
nmap/nmap.go
Line 173 in a750324
Do you see other possible fixes?
Thanks!
The text was updated successfully, but these errors were encountered: