On Mon, 28 Jul 1997, Ken Linder (KC7RAD) wrote:
Simply because one `Real' has eight bytes, and you are allocating one million of `Real's. 8000000 bytes are 7812.5kB; if you include code, runtime library, etc., 8094kB seems realistic for me.
It must be something associated with Linux. I also thought the allocation of memory should take place when the array is referenced. I stopped the program with a readln after the first FOR loop and sure enough, ~8108M was allocated (as seen from top).
The memory shows as allocated from top, but no physical allocation or paging occurs untill it's actually referenced. This is to prevent that more memory is allocated by all processes than the total amount of VM.
I know the java runtime allocates > 20M when initializing, but you don't notice anything untill it actually requires this amount of memory...
JJ
--- With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC1925.