diff options
author | Seth Mos <seth.mos@dds.nl> | 2011-10-19 08:55:20 +0200 |
---|---|---|
committer | Seth Mos <seth.mos@dds.nl> | 2011-10-19 08:55:20 +0200 |
commit | 1005d4bf8b764dbc0f98122bfe4b23becf58abf0 (patch) | |
tree | 2f103f81e5c9789f427408627434fc2010b15793 | |
parent | 9dfd60dbf5a85fd0528d7411a365316752defb83 (diff) | |
download | pfsense-1005d4bf8b764dbc0f98122bfe4b23becf58abf0.zip pfsense-1005d4bf8b764dbc0f98122bfe4b23becf58abf0.tar.gz |
Add the OOM memory restructuring fix from Ticket #1758 into mainline for nanoBSD upgrades.
-rw-r--r-- | etc/inc/upgrade_config.inc | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 80e736f..efe8ae9 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1979,8 +1979,7 @@ function upgrade_054_to_055() { mwexec("$rrdtool tune {$rrddbpath}{$database} -r roundtrip:delay 2>&1"); dump_rrd_to_xml("{$rrddbpath}/{$database}", "{$g['tmp_path']}/{$xmldump}"); - $rrdoldxml = file_get_contents("{$g['tmp_path']}/{$xmldump}"); - $rrdold = xml2array($rrdoldxml, 1, "tag"); + $rrdold = xml2array(file_get_contents("{$g['tmp_path']}/{$xmldump}"), 1, "tag"); $rrdold = $rrdold['rrd']; $i = 0; @@ -1998,6 +1997,8 @@ function upgrade_054_to_055() { file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", $rrdxml); mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1"); + unset($rrdold); + unset($rrdxmlarray); } /* let apinger recreate required files */ setup_gateways_monitor(); @@ -2036,12 +2037,10 @@ function upgrade_054_to_055() { /* create temporary xml from new RRD */ dump_rrd_to_xml("{$g['tmp_path']}/{$databasetmp}", "{$g['tmp_path']}/{$xmldumptmp}"); - $rrdoldxml = file_get_contents("{$g['tmp_path']}/{$xmldump}"); - $rrdold = xml2array($rrdoldxml, 1, "tag"); + $rrdold = xml2array(file_get_contents("{$g['tmp_path']}/{$xmldump}"), 1, "tag"); $rrdold = $rrdold['rrd']; - $rrdnewxml = file_get_contents("{$g['tmp_path']}/{$xmldumptmp}"); - $rrdnew = xml2array($rrdnewxml, 1, "tag"); + $rrdnew = xml2array(file_get_contents("{$g['tmp_path']}/{$xmldumptmp}"), 1, "tag"); $rrdnew = $rrdnew['rrd']; /* remove any MAX RRA's. Not needed for traffic. */ @@ -2058,6 +2057,9 @@ function upgrade_054_to_055() { file_put_contents("{$g['tmp_path']}/{$xmldumpnew}", $rrdxml); mwexec("$rrdtool restore -f {$g['tmp_path']}/{$xmldumpnew} {$rrddbpath}/{$database} 2>&1"); + unset($rrdold); + unset($rrdnew); + unset($rrdxmlarray); } enable_rrd_graphing(); /* Let's save the RRD graphs after we run enable RRD graphing */ |