Nmap Development mailing list archives

Re: [Zenmap-Patch] MemoryError


From: Jay Bosamiya <jaybosamiya () gmail com>
Date: Mon, 30 Jun 2014 23:23:32 +0530

List,

Please note that I have updated the analysis [1] with some further tests
that I ran.

The summary of the new results is

  * Glib error is NOT caused by the patch but by the restrictive
    environment (used for testing)
  * Memory usage DOES reduce when the error message is shown.

Note: In regards to the reduction in memory usage, it is the usage
inside python that reduces but not the memory that python itself uses.
This is because python, once it takes some memory from the OS for
itself, it doesn't return it until it is complete. However, any freed
memory (i.e. freed inside python by the patch) is reusable inside of
python itself without increasing the memory usage of python itself.
For example:

    a = 'z'*10000 # Uses a lot of memory (and python takes some memory
    from OS)
    del a # Frees memory inside python but python doesn't return the
    memory to the OS (so usage looks same from outside)
    b = 'y'*10000 # Uses a lot of memory (but python DOES NOT take
    memory from OS, since it already has enough) (so usage looks same
    from outside)
    # Python gives back memory to OS when it exits

If there are no objections, then I will be committing this patch tomorrow.

Cheers,
Jay

Links:
[1]
https://github.com/jaybosamiya/Nmap-Tests/blob/master/Memory-Analysis/Analysis.md

On Tuesday 24 June 2014 05:57 PM, Jay Bosamiya wrote:
Hi All!

I decided to do some analysis on memory usage in Zenmap before and
after the patch.

The analysis is at [1] and the statistics are at [2].

I hope this analysis will not only help push this patch for commit but
also will help point any further work in the correct direction.

As far as I can see, the output that Nmap generates is repeated at
multiple places in Zenmap leading to unnecessarily high memory usage.
Getting rid of these repetitions would reduce the memory consumption.
Also, if we were to use a file based paging system, then this will no
longer be a problem.

Cheers,
Jay

Links:
[1]
https://github.com/jaybosamiya/Nmap-Tests/blob/master/Memory-Analysis/Analysis.md
[2]
https://github.com/jaybosamiya/Nmap-Tests/blob/master/Memory-Analysis/Statistics.md
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: