--- deliantra/server/ext/checkrusage.ext 2007/01/25 03:55:01 1.2 +++ deliantra/server/ext/checkrusage.ext 2010/05/04 21:45:42 1.6 @@ -2,24 +2,23 @@ # restart server when certain resource limits are exceeded -use Unix::Getrusage; - our $MAX_VMSIZE = $cf::CFG{checkrusage}{vmsize} || 1_000_000_000; $^O eq "linux" or die "only linux supported right now.\n"; -Event->timer ( - reentrant => 0, - data => cf::WF_AUTOCANCEL, - interval => 10, - after => 10, - cb => sub { - open my $fh, "= $MAX_VMSIZE; - }, -); + cf::cleanup "memory usage growing high, server would run out of memory soon", 0 + if $vmsize >= $MAX_VMSIZE; + }; +};