[Oval-devel] Optimization in dsa2oval
Pavel Vinogradov
Pavel.Vinogradov at nixdev.net
Sun Nov 18 20:24:21 UTC 2007
Hi all.
On this weekend i was worked on reduce memory usage in dsa2oval script.
My last test show that script can't generate OVAL definitions file for full
Debian DSA tree on my laptop with 512 RAM. Script require too much memory
and OS start swapping script data to disk, but some data used for sort new
records. In result i have high load and can't receive result during 30
minutes.
In latest commit (rev. 305-310) i was rewrite most logic in class style
and use memory profiling to find memory consumer. Main problem is
createOVALDefinitions function which store full OVAL XML tree in memory. Now
i marked this function as deprecated and move it functionality to
printOVALDefinitions and i change strategy of storage resulted XML.
Now printOVALDefinitions write XML nodes to output stream as soon as
possible (when generated all child nodes). It currently implemented for
<definitions> node, but it may used and for <objects>, <tests>, <states>
nodes.
In result i have 30% reduce of memory usage, and test passed successfully
on my laptop. As a drawback i have some weakness in resulted XML formation,
but i will work on this issue in near future.
--
Pavel Vinogradov
NixDev.Net, Senior Linux Developer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/oval-devel/attachments/20071119/c57d848d/attachment.htm
More information about the Oval-devel
mailing list