Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arrays break memory limit under XP only??
#1
I had a program which used some fairly large arrays, but which ran perfeclty fine under Win98 and managed to stay under the 64k limit. But since upgrading to WinXP, trying to run that program produces error after error, all of the "out of memory", "out of data space", or "out of string space" variety, and always pointing to a dimensioned array (if I delete one, the error occurs immediately at the next large-ish one).

Does anyone know why this would be, or how to fix it? Why would arrays that were fine under 98 cause memory violations under XP?
Reply
#2
You've probably got too little free real memory. You can check by opening a command prompt and typing "mem" (without the quotes).

What happens if you compile the program and run it outside the editor?
Reply
#3
According to "mem" I've got 633,744 as largest executable progam size, which seems like quite a good bit in conventional memory terms.

Currently I can't compile the program because it's so huge that I need to split it into seperate modules (3 or 4) first and place the various subs and functions (a few hundred) throughout them in order to overcome the 64k program size. That worked fine and the compiled EXE ran fine under Win98, but haven't tried it under XP yet. I'll have to give it a shot, but ideally I'd like to be able to run the program from within the interpreter as well, since I make changes and test-run it about every 30 seconds or so, and compiling each time would be a real drag, especially when having to add simultaneously to the list of COMMON SHARED variables (another few hundred) in each module.
Reply
#4
Are you using QB 4.5?
Reply
#5
I'm using QB 7.1 actually, but I've also tried all the same things under QB 4.5 and VB for DOS 1.0. They all have the 64k program size limit at compile time.
Reply
#6
If you're running out of string space, you can enable far strings. But that's a compilation option that won't effect running in the interpretter.

Are you using '$dynamic ?
Reply
#7
I keep all my arrays $Static because I need to frequently use the ERASE command to remove all their content while keeping the arrays themselves intact. I suppose I could use REDIM or something, but that gets very tedious because they are all global (COMMON SHARED) and I have to type that every time.

I know there are probably other more involved workarounds involving subs or functions, but I'd still like to know why these memory errors occur under WinXP when it ran just fine under Win98.
Reply
#8
Quote:I know there are probably other more involved workarounds involving subs or functions, but I'd still like to know why these memory errors occur under WinXP when it ran just fine under Win98.
Windows XP and 2000 are much more strict in memory handling. You can't write/read where you don't have permission to, while Win98 almost lacked this.
If you have a memory error somewhere in your program (by your code, or by QB), then in WinXP you'll notice it much sooner than in Win98 because Win98 almost doesn't stop memory errors.
Reply
#9
There aren't actually any memory *errors* per se in the code, just arrays that appear to require more than 64k under WinXP. I'm not doing anything fancy enough to cause true memory address violations or anything. Just dimensioning simple, straightforward arrays based on user data types containing mixes of string and numerical variables.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)