StrongED: Not Enough Memory
David R. Lane (77) 766 posts |
On a Raspberry Pi 4 running RISC OS 5.28, StrongED stops accepting text input if 3 or 4 StrongED windows are open with the StrongED message “Not eough memory”. While on my ARMX6 running RISC OS 5.29 with exactly the same versions of StrongED and StrED_cfg – in fact all the files are the same – there is no such problem. Why? |
Rick Murray (539) 13840 posts |
How much memory on the Pi 4? Maybe someplace is miscalculating as a signed value, so something passing over 2GB will appear as a big negative number…? |
Martin Avison (27) 1494 posts |
The version of StrongEd might be relevant. |
David R. Lane (77) 766 posts |
According to the Tasks window (from the switcher), total memory is about 4GB with nearly all of that (3.9GB) free for applications. |
David R. Lane (77) 766 posts |
I should have added that the memory figures are for the Raspberry Pi 4. For the ARMX6, the figures are about 2GB and 0.75GB, respectively (about 1.1GB is allocated for the RAM disc). |
Raik (463) 2061 posts |
Long time ago (09/2020) Fred send me this link… |
Fred Graute (114) 645 posts |
Yep, exactly that. The undo code checks if there is enough memory to create a new undo record. This was using signed arithmetic and any negative number was taken to mean “Not enough memory”. Not that surprising as the code was written some 30 years ago when 4 MB was the most one could have (I’m ignoring the very expensive A540 here).
Correct, 470a14 is a snapshot that I took of my development version after having fixed the undo code. As such there may be unfinished bits, bugs, etc. In fact, there is a known bug that can be fatal. Others and myself have seen it but so far no reproducible case has been found which is needed for proper investigation. Also, there may be more issues on machines with more than 2GB due to signed calculations that haven’t been found yet. In short, feel free try out 4.70a14 but keep the above in mind. Because of the bug I’d also advise to make sure that auto-save is on and with a short interval, say 1 minute. Edit: fix mistyped version number |
Rick Murray (539) 13840 posts |
Probably simpler to say “when the most the ARM was capable of addressing was 64 MB”.
That’s why the RMA is below 2GB. But when you have a machine with 4GB or more, something has to go there, and that is when you’ll see if the programmer mixed up BLT/BLO, BGE/BHS, and BGT/BHI. (for non-geeks reading, the acronymns are…signed: Less Than, Greater than or Equal, Greater Than; unligned: LOwer, Higher or Same, HIgher)
Ditto Zap. Sometimes it keels over dead. Does it for me from time to time, did it for Dave recently. But as far as I can determine in my use, there’s no evident direct trigger, more an “accumulated cruft”, possibly? The joy of programming. ;) |
David R. Lane (77) 766 posts |
So, I have installed, if that’s the right word for RISC OS applications, version 4.70a14 of StrongED along with its companion, StrED_cfg from the link in Raik’s post above. Raik, thanks for that. I searched through the manual for anything to do with memory, but nothing seemed to be relevant to my problem. I searched through this forum for anything relevant using StrongED as search term, but found nothing on my problem. RISC OS runs on many computers now with 4GB or more memory and the problem with opening more than 2 or 3 StrongED windows is something that many users will encounter. So this is not some minor bug. Perhaps this major bug should have been made prominent to users. I have done a quick test of opening StrongED windows with this test release and got up to 7 windows without any problems. |
Rick Murray (539) 13840 posts |
That’s normal – it’s the same for RISC OS itself, the even versus the odd version numbers. Think of the proper releases as “checked and believed to be working” and the test versions as “work in progress”.
Which is why you asked, and got a reply…
I think Fred is aware of the need to fix the problem, but that being said…
…that you found nothing on the forum suggests that either people have tried, noted the crash, and decided to use Edit instead, or there aren’t as “many users” as you think. But, yes, it’s a problem that has been identified and is getting fixed.
Jeez, nobody is perfect. I would imagine I’ve made the same error myself, given that I have to remind myself it is LO and HI and not LT and GT. The RMA is below 2GB because if it wasn’t, a metric f***tonne of stuff would break. All for the confusion between signed and unsigned comparisons that was largely irrelevant to RISC OS until machines crossed the 2GB boundary and suddenly the highest bit of a number was set, which now means something completely different between signed and unsigned numbers. |
David R. Lane (77) 766 posts |
@Rick I have a rough idea about the explanation of the problem, but users like me have other interests in their lives than spending time going into the details. Your explanation of why there is nothing on the forum about the problem, doesn’t alter what I said. |
Alan Adams (2486) 1149 posts |
There’s me for one. |
David R. Lane (77) 766 posts |
Good on you! That makes two of us. |
Frederick Bambrough (1372) 837 posts |
So the same as the issue I see with the same error when trying to delete more than one character in a text on my RPi 4GiB? Also v 4.69f11. edit: Oh, yes. 470a14 fixes. |
Fred Graute (114) 645 posts |
@David Apologies for the delay in replying. There were things outside of RISC OS that needed my attention.
The 4.69 manual doesn’t mention this problem as it was not known at the time when 4.69f11 was released.
Most users with this problem have contacted me personally, either directly or through the StrongED mailing list. There have been a few mentions on this forum (search for 4.70a14).
The number of windows that can be opened is not a good test for this bug, especially when it’s two different versions of StrongED. Editing a file and copying/deleting large blocks of text is a better way as that involves the undo system. |
Fred Graute (114) 645 posts |
@Rick
Ah yes, there was that too. Thanks for the reminder.
Not in case for the SE 4.70a14 bug. I think I know which part of the code the bug is in. It just needs a reliable way of invoking the bug so that can I drill down to the exact cause.
Well, it certainly keeps things “interesting”. :-) |
Paolo Fabio Zaino (28) 1882 posts |
@ Fred Hi Fred, any chance that 4.69f12 is available now, as per your comment here soem time ago: https://www.riscosopen.org/forum/forums/1/topics/17071?page=3#posts-131082 If so, where could I download it, please? Thanks! |
Fred Graute (114) 645 posts |
@Paolo StrongED 4.69f12 and various other updated applications are close to release. They just need the nasty stuff doing, aka manuals. SE 4.69f12 also needs testing of a few add-ons such as DigDirSED and SrcFind. Hopefully they’ll be out soon, I’m aiming to have them done before the Big Ben Club’s ROX (14th of May). |
Stefan Fröhling (7826) 167 posts |
@Fred B) Any chance that you make it configurable which clipboard keyshortcuts are used (Classic RISC OS or modern CTRL+C,V,X) |
Fred Graute (114) 645 posts |
@Stefan
I have a version of StrongED that has such an option, but I’m not sure about including it. It works, however:
As an alternative to the above I’ve also written a BASIC proglet to switch over the definitions for c-C,V,X,Z and cs-C,V,X,Z. Not as convenient but it avoids the need for code changes. However at the moment that’s all academic as I seem to have lost se4.69f12 so I’ll need to recreate it first. :-( |
Andrew McCarthy (3688) 605 posts |
Whilst editing a Python file, I came across the “Not Enough Memory” constraint; I was adding comments to the file. Following the advice above, I upgraded to StrongED 4.70a13 and downloaded the script/zip file for Python support. I upgraded by dropping the !StrED_cfg over the existing one, located in Boot, Choices. I replaced !StrongED with the new version from the zip file. The error now appears, not in adding text to a comments line but using backspace to remove the test line of text. Perhaps, this is an edge case if I’m the only person to have triggered the issue again. |
Fred Graute (114) 645 posts |
The advice was to download StrongED 4.70a14 as that has the problem ‘Not enough memory’ fixed. 4.70a14 meanwhile has been superseded by 4.70a15 Word of warning: do not download this unless you want to test an alpha grade version of StrongED, or you have a machine with more than 2GB of memory in which case you need this version. Cause, you know, there will be bugs. As a matter of fact, I fixed one just yesterday. |
Andrew McCarthy (3688) 605 posts |
Fred, Thank you for the update; I’ve run it without issue. Are there any line editor features in a StrongED task window? |
Fred Graute (114) 645 posts |
You can use the LineEditor module with StrongED too. It not have the full support that Zap provides. If there’s anything you’re missing let me know and I’ll see what can be done. |