-
Notifications
You must be signed in to change notification settings - Fork 16
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
Flush results to output as they are fetched #31
Comments
My guess is that because
Yea I think this is a good idea, maybe the solution is to make Depending on the cli flag we then either remove the duplicates by collecting the iterator into a |
I think that sounds great! |
Another thing I noticed while digging into this issue was that I was allocating another large vec for the SonarSearch results coming over grpc. Lines 48 to 63 in 3782231
Because the type returned by the line below implements the Stream trait we could probably just return that and avoid all those extra allocations.Line 56 in 3782231
So the method would look something like: pub async fn get_subs(&mut self, host: Arc<String>) -> Result<impl Stream<Item = std::result::Result<Domain, Status>>> {
trace!("querying crobat client for subdomains");
let request = tonic::Request::new(QueryRequest {
query: host.to_string(),
});
debug!("{:?}", &request);
let stream = self.client.get_subdomains(request).await?.into_inner();
Ok(stream)
} |
Currently the tool fetches all subdomains and at the end prints them all to stdout. When running again targets with very large amounts of subdomains, this allocates a very large vector for subdomains before calling
cleaner.clean(subdomains)
. This is made worse by the fact that I'm running Vita on a 2 GB VPS which simply can't handle it and crashes.vita -d comcast.net
results inmemory allocation of 1610612736 bytes failed
I don't know if there's something going wrong with the error message, but that's quite a bit of memory!Flushing results to output as they are fetched would solve that, however it might make it difficult to output only unique results. Personally I wouldn't mind a
--flush
switch that outputs duplicated results.The text was updated successfully, but these errors were encountered: