Faceless MC -- Memory Failure
Sannyasin Sivakatirswami
katir at hindu.org
Tue Aug 17 16:57:08 EDT 2004
Greetings,
I'm trying to write a filter for a Linux system using x-talk rather than
C, Perl, etc .. and I am running out of memory. My mc interpreter is
failing with s signal 11 and giving this message:
/usr/local/bin/mc: out of memory
The problem is I suppose due to the size of the data file I'm trying to
process in a single container - it's nearly 800 Meg. Files almost as
large make it ok though.
I am hoping maybe a newer version would help, or, switch to the Rev
engine. This is on SuSE Linux. You might ask, which version of the
MC interpreter do you have? Ah .. not sure, it appears to have been
installed April 2003 .. the size is:
1889896 Apr 18 2003 /usr/local/bin/mc
Another option might be to rewrite my filter in some more efficient
manner. I'll probably try that approach too, I have a couple ideas.
In any case, I'd appreciate your thoughts if you have a suggestion.
Source code below.
Aloha,
Sadhu Nadesan
sadhu at castandcrew.com
-------------------cut here----------------------
#!/usr/local/bin/mc
########################################################################
#######
#
# -=< Payroll II >=-
# Copyright (c) Cast & Crew Entertainment Services, Inc. 2004
#
# Program name: adjustment_dater
# File name: adjustment_dater.mt
# Author: Sadhunathan Nadesan
# Date started: 08/11/2004
#
# Description:
# Pre processing for MT RTS file, put PC check date into PR checks
#
########################################################################
#######
on startup
put $1 into inputFile
open file inputFile for read
read from file inputFile until eof
put it into inputData
close file inputFile
// find reversed checks
repeat for each line thisLine in inputData
if (char 1 to 2 of thisLine contains "PC") then
put char 4 to 11 of thisLine \ -- reversed by ck seq #
& "|" \
& char 13 to 22 of thisLine \ -- check effective date
& linefeed after pcDateArray
end if -- a reversed check
end repeat
split pcDateArray by linefeed and "|"
// patch the date of the reversing check
repeat for each line thisLine in inputData
if (char 1 to 2 of thisLine contains "PR") then
put char 24 to 31 of thisLine into sequenceNumber
put pcDateArray[sequenceNumber] into char 13 to 22 of thisLine
end if -- reversing check
// now pass the modified data on
put thisLine
end repeat
end startup
More information about the use-livecode
mailing list