Author | Topic: Large arrays bug? | |
---|---|---|
Johan | Large arrays bug? on Fri, 12 Mar 2010 08:15:51 +0100 Hi! Following lines of code reproduces a problem I've encountered with large arrays: ***************** PROCEDURE MAIN LOCAL aArray:={}, n FOR n:=1 TO 200000 Aadd(aArray, {time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time()}) ?? n NEXT MsgBox("Ready!") RETURN ***************** The program terminates with following xppfatal.log: ********************* FATAL ERROR LOG Not recoverable Error! SYS Thread-ID: 408 Module: MOM Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 Call Stack of Thread 1 (408): MAIN(6) Call Stack of GUI Thread (616): File: D:\sysutv\WinBib\Arraytest\NISSE.exe TimeStamp: 20100312 07:56 End of FATAL ERROR LOG. FATAL ERROR LOG Not recoverable Error! SYS Thread-ID: 408 Module: MOM Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 Call Stack of Thread 1 (408): MAIN(6) Call Stack of GUI Thread (620): File: D:\sysutv\WinBib\Arraytest\NISSE.exe TimeStamp: 20100312 07:57 End of FATAL ERROR LOG. ************************** I'll have find my own workaround for this, but maybe somebody else finds this interesting. Regards, Johan Lammassaari | |
Jan Groenestein | Re: Large arrays bug? on Fri, 12 Mar 2010 10:38:50 +0100 Hello Johan, As they say at Microsoft : "This is not a bug, this is a feature". I suspect that your large array makes your application exceed the maximum number of memory handles that Xbase++ provides. Each array element takes up a handle, which allows very good performance of Xbase array functions. Your array of 200.000 * 14 elements surpasses the 2.000.000 handles limit. I struggled with the same problem and received a special fix for that in our GB Geographics application. Maybe you can ask Alaska for that special fix too. Regards, Jan Groenestein Johan schreef: > Hi! > > Following lines of code reproduces a problem I've encountered with large > arrays: > > ***************** > PROCEDURE MAIN > LOCAL aArray:={}, n > > > FOR n:=1 TO 200000 > Aadd(aArray, > {time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time()}) > > ?? n > NEXT > MsgBox("Ready!") > RETURN > ***************** > > The program terminates with following xppfatal.log: > ********************* > FATAL ERROR LOG > Not recoverable Error! > SYS Thread-ID: 408 > Module: MOM > Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 > Call Stack of Thread 1 (408): > MAIN(6) > Call Stack of GUI Thread (616): > File: D:\sysutv\WinBib\Arraytest\NISSE.exe > TimeStamp: 20100312 07:56 > End of FATAL ERROR LOG. > FATAL ERROR LOG > Not recoverable Error! > SYS Thread-ID: 408 > Module: MOM > Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 > Call Stack of Thread 1 (408): > MAIN(6) > Call Stack of GUI Thread (620): > File: D:\sysutv\WinBib\Arraytest\NISSE.exe > TimeStamp: 20100312 07:57 > End of FATAL ERROR LOG. > ************************** > > I'll have find my own workaround for this, but maybe somebody else finds > this interesting. > > Regards, > > Johan Lammassaari | |
Johan | Re: Large arrays bug? on Fri, 12 Mar 2010 11:39:04 +0100 Thanks Jan! Always good to know what one talks about, so thank's for the explanation! I'll solve my problem by doing the same thing in smaller chunks so there's an easy fix for me (albeit not 100% satisfactory). Maybe I just should suggest an revision on the documentation where it says "Neither the number of elements in an array nor the number of array dimensions are limited." (but, of course, there is always an limit to everything....). Regards, Johan Lammassaari "Jan Groenestein" <jg@gbor.nl> skrev i meddelandet news:76aa9d82$16a52a95$588e@news.alaska-software.com... > Hello Johan, > > As they say at Microsoft : "This is not a bug, this is a feature". > I suspect that your large array makes your application exceed the maximum > number of memory handles that Xbase++ provides. Each array element takes > up a handle, which allows very good performance of Xbase array functions. > Your array of 200.000 * 14 elements surpasses the 2.000.000 handles limit. > I struggled with the same problem and received a special fix for that in > our GB Geographics application. Maybe you can ask Alaska for that special > fix too. > > Regards, > Jan Groenestein > > Johan schreef: >> Hi! >> >> Following lines of code reproduces a problem I've encountered with large >> arrays: >> >> ***************** >> PROCEDURE MAIN >> LOCAL aArray:={}, n >> >> >> FOR n:=1 TO 200000 >> Aadd(aArray, >> {time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time(),time()}) >> ?? n >> NEXT >> MsgBox("Ready!") >> RETURN >> ***************** >> >> The program terminates with following xppfatal.log: >> ********************* >> FATAL ERROR LOG >> Not recoverable Error! >> SYS Thread-ID: 408 >> Module: MOM >> Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 >> Call Stack of Thread 1 (408): >> MAIN(6) >> Call Stack of GUI Thread (616): >> File: D:\sysutv\WinBib\Arraytest\NISSE.exe >> TimeStamp: 20100312 07:56 >> End of FATAL ERROR LOG. >> FATAL ERROR LOG >> Not recoverable Error! >> SYS Thread-ID: 408 >> Module: MOM >> Error Codes: EH: 1006 Sub: 0(0) OS: 0 XPP: 15 >> Call Stack of Thread 1 (408): >> MAIN(6) >> Call Stack of GUI Thread (620): >> File: D:\sysutv\WinBib\Arraytest\NISSE.exe >> TimeStamp: 20100312 07:57 >> End of FATAL ERROR LOG. >> ************************** >> >> I'll have find my own workaround for this, but maybe somebody else finds >> this interesting. >> >> Regards, >> >> Johan Lammassaari |