Attached is a Perl script which increases datasize to maximum
for BSD type Unix running OpenDX. Tested on NetBSD. Should work
for any BSD Unix which has the command 'sysctl' and Perl.
Do chmod to 755 and call as... hog_memory.pl
Or else call as... perl hog_memory.pl
Enjoy,
Gan
--
Mistera Sturno - Rarest Extinct Bird
<(+)__ Gan Uesli Starling
((__/)=- Kalamazoo, MI, USA
`||`
++ http://starling.us
sub hog_memory {
# Avoids out-of-memory error for huge files by setting datasize to max.
my @procs = @_;
# Get max datasize from NetBSD.
my @lines = split ' ', `sysctl proc | grep datasize.hard`;
my $datasize_max = $lines[-1];
foreach my $proc ( @procs ) {
@lines = split "\n", `ps -xa | grep $proc`;
# May be more than one copy of editor running.
foreach my $line ( @lines ) {
next if $line =~ /ps -xa|grep/;
my @line = split ' ', $line;
print "Increasing datasize to maximum for process $line[4]\n";
print `sysctl -w proc.$line[0].rlimit.datasize.soft=$datasize_max`,
"\n";
}
}
}
hog_memory('dxexec', 'gus_rpc_edit.pl');