Running processes and available memory ?

Helpful tips and guides, also new users can ask for help here.
Post Reply
JihemB
ROM Dongle
Posts: 8
Joined: Thu Jan 17, 2019 1:38 pm

Running processes and available memory ?

Post by JihemB »

Hello.
I'm a newbie with Sinclair QL (although I deal with several other computers from the 80s, mainly 8 bits).
I recently got a Tetroid interface card with Minerva ROM, built-in Toolkit 2, floppy disc interface and 768k extra memory.

I'm currently trying to extract some programs from disc using the unzip tool I put on RAM1_.
After a few commands, unzip fails with "out of memory" error.
I suspect this may because some programs remains in memory although I think they stopped (BTW : If I call TK2_EXT more than once, do I load Toolkit 2 several times ?)

Since QDOS is AFAIK a premptive multitasking OS, is there a "Linux ps" like command to list all running processes ?
How to check the memory usage ?

Thanks in advance for your help.
Last edited by JihemB on Tue Feb 12, 2019 5:04 pm, edited 2 times in total.


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Running processes and available memory ?

Post by tofro »

JihemB wrote:Hello.
I'm a newbie with Sinclair QL (although I deal with several other 8 bits computers).
Welcome - but don't call the QL an 8-bit computer. People might get upset ;)
JihemB wrote: I recently got a Tetroid interface card with Minerva ROM, built-in Toolkit 2, floppy disc interface and 768k extra memory.
Good choice to get the true feeling ;)
JihemB wrote: I'm currently trying to extract some programs from disc using the unzip tool I put on RAM1_.
Do you, by any chance, extract the files to the ram disc? Or have you just put the unzip binary there? Unzip will put the files onto the "current data directory" which is set by DATA_USE if not told otherwise. In case that's the RAM disk, that will eat away your plenty memory quickly.

How do you start unzip? In case you use "ex" or "EXEC", that will put the new unzip job executing in the background, once it finishes, it should, however, terminate itself. Use "EW" or "EXEC_W" if you want to have the job occupy the keyboard until its job is done.
JihemB wrote: After a few commands, unzip fails with "out of memory" error.
I suspect this may because some programs remains in memory although I think they stopped (BTW : If I call TK2_EXT more than once, do I load Toolkit 2 several times ?)
No - TK2_EXT simply links in the extra commands from the toolkit - shouldn't eat up memory.
JihemB wrote: Since QDOS is AFAIK a premptive multitasking OS, is there a "Linux ps" like command to list all running processes ?
How to check the memory usage ?
First, you can pull every running job to the foreground - <CTRL>C will cycle through all jobs that currently display a cursor.
Second, you can enter "JOBS" which will display all running jobs (but not their memory consumption). To find the amount of memory taken by a specific job, you'd need some specific applications that will have more specific requirements on the environment. SysMon (from QPAC 1) will display all running jobs with their heap usage - But that needs a running pointer environment.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
JihemB
ROM Dongle
Posts: 8
Joined: Thu Jan 17, 2019 1:38 pm

Re: Running processes and available memory ?

Post by JihemB »

Hi Tobias.
Welcome - but don't call the QL an 8-bit computer. People might get upset ;)
Actually I didn't meant QL is a 8 bit computer (since there is a 68000 inside as the MacIntosh 12 days later), but I meant "I have no such problems with other computer from my collection which are 8 bits".
Anyway, I edit the post to remove the doubt...
Do you, by any chance, extract the files to the ram disc?
Yes, I do. I first put UNZIP in RAM1_ and I manage to extract files from FLP1_ to RAM2_ or FLP2_ (as mentioned in another post, I also have problems with the "-d" option).
How do you start unzip? In case you use "ex" or "EXEC", that will put the new unzip job executing in the background, once it finishes, it should, however, terminate itself. Use "EW" or "EXEC_W" if you want to have the job occupy the keyboard until its job is done.
The command should be something like : EW RAM1_unzip;"-d flp2_ flp1_zipfile"
Currently I have to cope with a "flp2_ not found" or "Unable to extract to flp2_" and get the same error if I use RAM2_ as target, so I have to use "EW RAM1_unzip;"flp1_zipfile" which can't complete since there is not enough room on flp1_ . Would the DATA_USE value interfer with -d option ?

While trying to find the good parameter option (let's say 3 or 4 times) I reach the point where I get the out of memory error whenever I try to unzip something.

I'll take a screen capture next time I face the problem if needed.

Is there a way to recall a command previous entered to avoid re-enter it completely ?

JihemB


User avatar
tofro
Font of All Knowledge
Posts: 2685
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: Running processes and available memory ?

Post by tofro »

unzip uses the data default directory as a target directory - If you specify that one, you can omit the "-d" option.

DATA_USE ram2_ : EW ram1_UNZIP; "flp1_zipfile"

will do the same thing as

EW ram1_unzip;"-d ram2_ flp1_zipfile"

If you unzip to ram2_, the unpacked files will obviously occupy valuable memory - It's easy to run into out of memory errors that way (ram disks grow dynamically with the amount of files you put there). You should actually unpack to flp2_, if you can.

Tobias


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
JihemB
ROM Dongle
Posts: 8
Joined: Thu Jan 17, 2019 1:38 pm

Re: Running processes and available memory ?

Post by JihemB »

Hi Tobias
...ram disks grow dynamically with the amount of files you put there...
That's it ! The more I write files on ram disks, the less RAM remains that explains why I eventually run out of memory.
I always thought the RAM disc size was pre-allocated.

I will do the trick with DATA_USE and give you a feedback (but I still don't understand why the -d option doesn't work for me).


User avatar
janbredenbeek
Super Gold Card
Posts: 629
Joined: Wed Jan 21, 2015 4:54 pm
Location: Hilversum, The Netherlands

Re: Running processes and available memory ?

Post by janbredenbeek »

JihemB wrote:Hi Tobias
...ram disks grow dynamically with the amount of files you put there...
That's it ! The more I write files on ram disks, the less RAM remains that explains why I eventually run out of memory.
I always thought the RAM disc size was pre-allocated.
Actually you can create a RAM disk of fixed size by FORMATing it (e.g. FORMAT ram1_10000 gives you a RAM disk of 10000 sectors or 5 MB).
The maximum size you can specify is 32767 (16 MB), of course you will need enough memory to allocate a RAM disk of this size.

Jan.


Post Reply