English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 13 March 2014, 21:34   #1
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Memory hungry Amigados scripts

Lately, I have been creating script based applications for the Amiga. Nothing groundbreaking really, but very handy indeed.

The thing is, that I have noticed that to properly run those amigados scripts that were started with iconx, I need at least 178KB of free memory, if not the script will, at some point, fail due to low memory.

What I find frustrating, is that the script is not long and not complex, it just checks some conditions, and executes yet another script that contains a couple of lines with the copy command.

So am I doing something wrong, that all my scripts eat so much memory? Is there a way to overcome this?

I´d apreciate any hint.
gulliver is offline  
Old 13 March 2014, 22:13   #2
Lonewolf10
AMOS Extensions Developer
 
Lonewolf10's Avatar
 
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
Can you please attach the scripts so we can have a closer look?

It will be hard to say what is wrong without looking at them first.
Lonewolf10 is offline  
Old 13 March 2014, 22:40   #3
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Thank you for your answer.

I am attaching one of these little creatures I made.

you should uncompress and copy all files respecting their location for the script to work. It is designed to work under AmigaOS 3.1.

The application is called Rebooter and its docs are located under the Locale/Help/ drawer. The application should be able run from both workbench and cli.

Remeber to issue a protect +s to the scripts so that Amigados doesnt complain.

I am all ears

Last edited by gulliver; 17 March 2014 at 19:41.
gulliver is offline  
Old 13 March 2014, 23:42   #4
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Maybe it is the amount of copy buffer used. You can test it by echo the copy/delete lines, so they are just printed. Or try to get more information about memory usage with "avail" commands in the script.

ps: Why don`t you use Requestchoice what comes with OS3.1 and is there a reason for so many subscripts?
daxb is offline  
Old 14 March 2014, 00:33   #5
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
Quote:
Originally Posted by daxb View Post
Maybe it is the amount of copy buffer used. You can test it by echo the copy/delete lines, so they are just printed. Or try to get more information about memory usage with "avail" commands in the script.

ps: Why don`t you use Requestchoice what comes with OS3.1 and is there a reason for so many subscripts?
I have already traced the amount of memory usage, the problem arises when the script is processing the copy command. With 175 KB of free memory it fails, but with 178KB it succeeds. So in a 512KB, under average load, it doesnt work

Many scripts are required, but it does not change a thing if I reduce them, or use requestchoice.

Another example, is the IconSet script I have in BetterWB (it uses requestchoice), and it only calls one other script. It fails the same way when copying glowicons when the memory available is under 178KB.
gulliver is offline  
Old 14 March 2014, 12:46   #6
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
First, my "avail" command advice wasn`t good. Did you tried to set copy buffer to a lower value (e.g. "BUF=10")? Some days ago I read here on eab that the default buffer is 100 or 200 (each 512 byte?) and is allocated in one chunk. And there is a bug in copy <40.1.

I asked the questions because it looked unnecessary complicated to me but you may call the scripts from various places what would make sense. Not because of memory usage.
daxb is offline  
Old 14 March 2014, 12:57   #7
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
It is not the copy bug you mention, as I have tried different copy command clones, and I get the same end result.

I am starting to believe, it is a fact of life in Amigados land that the memory requirements are so unnecesary high.

I apreciate your comments and suggestions, I already did some modifications to the scripts as you suggested.

I will try to modify the copy buffer as you mentioned, and report back.
gulliver is offline  
Old 17 March 2014, 19:43   #8
gulliver
BoingBagged
 
gulliver's Avatar
 
Join Date: Aug 2007
Location: The South of nowhere
Age: 46
Posts: 2,358
@daxb

Thank you very much!

Setting the copy buffer to a low value decreased the amount of memory used by the scripts to something very reasonable.
gulliver is offline  
Old 18 March 2014, 13:41   #9
daxb
Registered User
 
Join Date: Oct 2009
Location: Germany
Posts: 3,303
Nice that it works better for you. I assign the "thank" to the user(s) who wrote about the copy buffer because I just parroted that.
daxb is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
AmigaDOS scripts lloyd Coders. General 2 22 November 2004 19:47

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:12.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.13411 seconds with 13 queries