Nmap Development mailing list archives

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


From: Fyodor <fyodor () insecure org>
Date: Mon, 16 Mar 2009 21:45:49 -0700

On Mon, Mar 16, 2009 at 10:36:45PM -0600, David Fifield wrote:
On Tue, Mar 17, 2009 at 02:52:37AM +0000, Brandon Enright wrote:

It sounds like the right solution to me. It is reminiscent of
xml_convert, which used to allocate a worst-case six bytes per input
byte, even though the most bytes only take up one bytes of output.

If C++ STL routines make this jobs easier, then use them by all means.
We don't have to be compatible with C in the Nmap codebase.

Yeah, but if STL is used, it is important to test that it is suitably
performant from a CPU and memory usage perspective.  Increasing the
level of abstraction makes it easier to overlook inefficiency.  Of
course, the current case demonstrates that lower-level code can be
vulnerable to gross inefficiency too.  Particularly in a case like
this where it is scaled far beyond what was ever intended when it was
first written.

So I'm not against using the STL for this table printing as long as it
is done efficiently.  And it sounds like Brandon has some rigorous
test cases available to check that :).  Doing it in plain C is fine
too.

Cheers,
-F

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


Current thread: