in reply to generate a chart using the data

Does this also fail when used on a huge file?
Your division by 500 means you're expecting multiples of 500 points in each range.

This code does not work as presented, the

while (<IN_LOG>) { push (@array,$_); } }
should probably read
while (<IN_LOG>) { chomp; push (@array,$_); }
Try temporarily removing the $i/500 when using test data. To see what I mean, or set a suitable divisor print $i before division and see what sort of numbers are in each range

Though this does throw open the option of creating a suitable divisor on the basis of the max value of $i relative to display/paper size, saving a record, @{@records[$count]}=( $max, $min $pts) which could then scale the highest value of $pts back to an acceptable value on printing to your log file.