Nmap Development mailing list archives

Re: printtableSize() causing huge spike in memory usage at end of hostgroup


From: Brandon Enright <bmenrigh () ucsd edu>
Date: Tue, 24 Mar 2009 21:27:01 +0000

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 23 Mar 2009 22:03:03 -0600
David Fifield <david () bamsoftware com> wrote:

On Fri, Mar 20, 2009 at 11:20:00PM +0000, Brandon Enright wrote:
Comments/results inline.

On Tue, 17 Mar 2009 23:14:25 -0600
David Fifield <david () bamsoftware com> wrote:
On Tue, Mar 17, 2009 at 11:38:13PM +0000, Brandon Enright wrote:
Attached is a patch to use memory a little bit more efficiently.
The buffer starts at 1k and any time it is too small it is
doubled in size.  I did some testing that suggests for most
scans 1k is probably enough.

...snip...

What about a simple scan without -sV? 1024 seems a little high to
me.

It probably is.  The results at the bottom of this email show that.

To test the size of the table and how much memory gets allocated
with my patch, I ran 4 scans, each against the same /23.

...snip...


I think what this is telling us is that we should start the table
off at ~512 bytes rather than 1024.  In the average usage scenario
this will be almost no waste and shouldn't need to resize the table
more than once.  Note that the really huge table in the last scan
was from our DNS servers.  Every single name in the whole zone got
printed with the dns-zone-transfer script.

The patch looks good. Go ahead and commit it with the 512-byte initial
allocation.

David Fifield


Thanks, committed in r12670.

Brandon

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)

iEYEARECAAYFAknJUCwACgkQqaGPzAsl94LJCACgr0teUOn/gBZ0mpj5udLyFTB7
SVUAnjWq+3USGGjHkah1rLLd/cE7cTqm
=8j4d
-----END PGP SIGNATURE-----

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org


Current thread: