forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How much Ram required

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
colt1954



Joined: 21 Dec 2010
Posts: 81

PostPosted: Sun Aug 02, 2020 10:04 am    Post subject: How much Ram required Reply with quote

Hi,

A simple question for the excellent people on this forum, how can you determine how much 'ram' is required on a PC to execute a given programme, i guess its to some extent based on array sizes etc...??
Back to top
View user's profile Send private message
mecej4



Joined: 31 Oct 2006
Posts: 1884

PostPosted: Sun Aug 02, 2020 12:21 pm    Post subject: Reply with quote

These days, it is more common to use dynamically allocated arrays -- typically, arrays whose sizes are computed from earlier portions of input data. There is no simple, reliable way of keeping a tally of how much RAM is consumed; in fact, on Usenet comp.lang.fortran there was a very long thread on ideas related to this issue.

You can obtain the sizes of the "text" and "data" segments using Dumpbin or the Linux/Cygwin command size:

Code:
Q:\lang\mkl>size talmi.exe
   text    data     bss     dec     hex filename
19138759         106096       0 19244855        125a737 talmi.exe


You can open the Task Manager when the program is still running and look at the memory consumption.
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Sun Aug 02, 2020 4:59 pm    Post subject: Reply with quote

I'd accept that it is more common to use dynamically allocated arrays today in new code, or even if you are messing around with (or 'updating') old code. Mecej4 can probably tell you what goes wrong halfway through that! I had my fingers burnt with allocatable arrays in 1973 (in Algol 60) when the program worked OK when tested, but not with realistic data sets. Once bitten, twice shy. It wasn't Fortran, but after that I always used extremely trimmed-down array sizes and didn't proliferate arrays.

The old Microsoft Fortran had a utility that extracted exactly the sort of information that you are looking for from an EXE file header, but presumably this information is stored somewhere even today, and could be extracted if you need to and can find someone with the skills to extract the data from your EXE

I don't reckon that the RAM consumption is ever much of a problem with an up to date PC, unless you want to manage huge datasets (like John Campbell). For example, everything I ever wrote works fine on a Windows XP laptop with 1Gb, or a Windows 10 32-bit tablet, also with 1 Gb.

I suggest looking in Task Manager at how much free RAM you have before you attempt a trial load of your program as well as when it is running - as Mecej4 suggests. I think that (unless you are like JC) you will be surprised at how little space it uses. Another trick is to work out the sizes of all your REAL*8 arrays. Only include INTEGER, REAL*4 or COMPLEX if you use a lot of them. Again, I guess the answer will be nowhere near your free capacity. The rest, including executable code is again a lot smaller than you think.

For example, take a 5000x5000 array with REAL*8. That's still only 200Mb - and how many of those do you have?

My guess is that it's a lot smaller than you think. My 16Gb machine runs with 12.2 Gb free, and a lot of the used space is taken up with disk cache and OS plus dribs and drabs that other software loads in advance.

And if it's too small, then buy some more RAM or even a new computer, which turns out much cheaper than struggling unless, of course, you count your time as effectively worthless. I could double the 16Gb in my PC for only £60 currently, and you don't buy much of my time for that! Incidentally, all the components in replacing the innards of an existing computer could cost between £150 - £300 because there's absolutely no point in having too many cores just to run FTN95 programs.

Eddie


Last edited by LitusSaxonicum on Mon Aug 10, 2020 3:14 pm; edited 1 time in total
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2551
Location: Sydney

PostPosted: Mon Aug 03, 2020 2:04 pm    Post subject: Re: How much Ram required Reply with quote

colt1954 wrote:
Hi,

A simple question for the excellent people on this forum, how can you determine how much 'ram' is required on a PC to execute a given programme, i guess its to some extent based on array sizes etc...??


This is not a simple question, so not sure how detailed the answer required is, especially for 64-bit .exe.

You can use task manager to get an estimate of the memory in use at any time. This can vary depending on how much memory is initialised or referenced. This basically includes code, and initialised arrays.

With lots of subroutines and local arrays, how much of the stack in use can be estimated, but can be difficult to calculate.

ALLOCATE arrays are a special case, as they don't use physical memory until they are "used". Certainly, ALLOCATE arrays are not included in the physical memory allocated until they are both allocated and used.

Also physical memory pages are not allocated until each memory page is referenced, so large allocate arrays can become virtual arrays if used in that way. I have examples of a 16gb allocated array that only uses 1gb of physical memory, although this is a contrived case.

The best answer is to use Task Manager "Processes" tab (Win 7) and monitor the variation.
Back to top
View user's profile Send private message
John-Silver



Joined: 30 Jul 2013
Posts: 1520
Location: Aerospace Valley

PostPosted: Thu Aug 06, 2020 1:37 pm    Post subject: Reply with quote

Or, you pays no money and you takes yer pick of the Alternatives to TaskManager
_________________
''Computers (HAL and MARVIN excepted) are incredibly rigid. They question nothing. Especially input data.Human beings are incredibly trusting of computers and don't check input data. Together cocking up even the simplest calculation ... Smile "
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1214
Location: Morrison, CO, USA

PostPosted: Mon Aug 10, 2020 3:04 pm    Post subject: Reply with quote

Just as a math question, Eddie, 5K by 50K of REAL*8 is 2 gigabytes. Did you mean 5K by 5K?
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Mon Aug 10, 2020 3:15 pm    Post subject: Reply with quote

Yes I did. I've corrected it now. Thanks.

Eddie
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group