1. Apparent bug in 2.3
- Posted by rforno at tutopia.com Dec 09, 2001
- 376 views
As I was having some problems with my equipment under Windows 98 SE, and not satisfied with some system tests that are available, I developed this little program to test extended RAM. I have not run it under 2.2 but only under 2.3. I used plain DOS, not a DOS window. While no virtual memory is used, if one types a key other than 'e', the sequence length at this moment is displayed. But when the program starts to use virtual memory, typed keys have no effect, the disk is constantly accessed, and the only way to stop the program is to hit ctrl-alt-del or the reset button. I haven't tried this on a DOS window nor by exw. constant MAXINT = 1073741823 --Largest Euphoria integer procedure memtest() sequence s integer n, len s = {} len = 0 while 1 do n = rand(MAXINT) s &= n len += 1 if n != s[len] then printf(1, "Error: %d != %d at %d\n", {n, s[len], len}) return end if n = get_key() if n = 'e' then return elsif n != -1 then ? len end if end while end procedure memtest()
2. Re: Apparent bug in 2.3
- Posted by Robert Craig <rds at RapidEuphoria.com> Dec 09, 2001
- 388 views
rforno writes: > But when the program starts to > use virtual memory, typed keys have no effect, the disk is constantly > accessed, and the only way to stop the program is to hit ctrl-alt-del or the > reset button. When you use swap space, performance can become extremely bad, especially on algorithms like this, where Euphoria has to internally access all the elements of a huge sequence from start to end. Your statement: s &= n will periodically require a complete new copy of a huge sequence to be made. If this is done using swap space it can eventually take seconds or even minutes to complete. Meanwhile, your keypresses appear to have no effect, although if you wait long enough it should eventually stop. That might be a *long* time. Swap space works best when you only use a little of it, or when your algorithm has high "locality of reference" to data (which concatenation does not.) Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com