Skip to content
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 #131

Open
vancho-go opened this issue Jul 11, 2024 · 3 comments
Open

Memory Usage is too high #131

vancho-go opened this issue Jul 11, 2024 · 3 comments

Comments

@vancho-go
Copy link

Even without using Progress() the memory usage is incredible when running in container.

scanner, _ := nmap.NewScanner(
			ctx,
			nmap.WithTargets(ips...),
			nmap.WithPorts(strconv.Itoa(port)),
			nmap.WithServiceInfo(),
			nmap.WithTimingTemplate(nmap.TimingAggressive),
			nmap.WithScripts(scripts...),
			nmap.WithOpenOnly(),
			nmap.WithSkipHostDiscovery(),
		)

		result, warnings, err := scanner.Run()
Снимок экрана 2024-07-11 в 20 31 35

Any possible solutions?

@Ullaakut
Copy link
Owner

Hi @vancho-go ! Thanks for reaching out :))

The output of the scan is likely very large, so I would recommend breaking it into multiple smaller scans if you want to limit memory usage. May I ask, around how many individual hosts are you targeting with your scan to reach 8.9GB?

If the number is low, then the issue might lie somewhere else.

@vancho-go
Copy link
Author

Hi @Ullaakut, the scan does target a large number of hosts (hundreds), however, when running not in a container, I tried to scan several times more hosts, and the memory consumption was several times less.

@Ullaakut
Copy link
Owner

Mh that's interesting 🤔 Maybe it's an issue with the nmap/curl versions used in the container? Or maybe there is some memory overhead to outbound connections from the container, which absolutely could make sense.

Are you running Docker natively or through Docker for Mac / Docker for Windows ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants