]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commit
While restoring, rrd_restore uses between 30 and 40 times as much memory as
authorTobias Oetiker <tobi@oetiker.ch>
Mon, 25 May 2009 22:23:06 +0000 (22:23 +0000)
committerTobias Oetiker <tobi@oetiker.ch>
Mon, 25 May 2009 22:23:06 +0000 (22:23 +0000)
commit2959781925911337cb888efec6fe353ffe032407
tree040481b59e3fda5fbc5acdde4b4b0634f9b453d1
parent7a7a06e4464e27c4f85ace36326d296bdee990ee
While restoring, rrd_restore uses between 30 and 40 times as much memory as
the size of the rrd file to be restored. This is due to the use of libxml2
for parsing the the whole file prior to turning it into rrd structs.

This patch switches rrd_restore to using the xmlTextReader interface for
incremental consumtion of xml files. This reduces the memory requirements to
about twice the size of the rrd file which should be quite manageable for
most cases.

The parsing is about 25% less efficient than with the original libxml2
version of rrd_restore. This could be in part due to the more liberal use of
malloced memory. Optimizing this is for another day though.

--tobi

git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@1811 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_restore.c