crash has developed

Here you can talk about anything related to BBC BASIC, not covered in another category
Ric
Posts: 314
Joined: Tue 17 Apr 2018, 21:03

crash has developed

Post by Ric »

I have included this:
HIMEM=(LOMEM+(2000000000)) AND -4
at the beginning of my program because is needs a lot of memory to run (albeit not that much), but i have reached a point in my code where i can no longer add anything because it crashes. Can any one suggest a solution. My program is just over 5000 lines plus several libraries. I have tried reducing the amount of data the program loads by reducing the DIMed memory, but that doesnt seem to make a difference.
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Richard Russell
Posts: 714
Joined: Tue 18 Jun 2024, 09:32

Re: crash has developed

Post by Richard Russell »

Ric wrote: Fri 31 Jul 2026, 15:46 I have included this:
HIMEM=(LOMEM+(2000000000)) AND -4
at the beginning of my program because is needs a lot of memory to run (albeit not that much), but i have reached a point in my code where i can no longer add anything because it crashes. Can any one suggest a solution. My program is just over 5000 lines.
Sorry, I don't understand. You seem to be linking two apparently unrelated quantities: the amount of memory used by your program when it is running (for example by arrays, as they are typically the only data structure able to use very large amounts of memory) and the size of your BASIC program itself (you mention that it's just over 5000 lines, which would suggest a total size of perhaps 200 kilobytes).

There are four orders-of-magnitude difference between these two quantities: the 2 Gigabytes (!) reserved by raising HIMEM is 10,000 times the size of your program! So I don't understand why you seem to think they are connected. The program itself is relatively modest in size (SDLIDE.bbc is also about 5000 lines) whereas the amount of memory it needs when running is massive. :shock:

So please explain what the problem actually is, or are there two problems which you have concluded are linked when they probably aren't?