From: haroldt@orion.yorku.ca
Subject: Re: 3.51? && max memory of 2.4Megs?  HELP!!!
Organization: York University
Date: Tue, 15 Sep 1992 18:23:49 GMT

In article <3819@ecicrl.ocunix.on.ca>, clewis@ferret.ocunix.on.ca (Chris Lewis) writes:
> In article <1992Sep14.100001.1@orion.yorku.ca> haroldt@orion.yorku.ca writes:
> 
>>0) How do I know if I'm running OS version 3.51 
> 
> $ ls -l /UNIX*
> -rwxr-xr-x  2 root    root     168707 Jan  1  1970 /UNIX3.51
> -rwxr-xr-x  2 root    users    174174 Apr  8 20:01 /UNIX3.51m

  Thank-you.  Now I know for sure that I'm running 3.5.  Blast!
That's probably half of my problem.  After this I'll stop asking 
questions until I have 3.51m installed and running.

>>1) How do I acquire 3.51?  
> 
> Find somebody who has a copy and borrow it.

  Does the purchase of 3.5 entitle you to a copy of 3.51?  I 
actually asked the question (1 above) in order to drop a 
not-too-subtle hint.  I guess everyone is ignoring it.

>>2) How do I get to create a process in excess of 2.5Megs?
> 
> You can't.  It's a hardware limitation - the memory translation
> hardware is designed to provide each process with a maximum of 4Mb,
> of which 1.5Mb is taken up by the shared libraries and the kernel
> (which is inaccessible).  You can add more physical memory or swap,
> but programs can be 2.5Mb maximum.


  I'm about to assume that under 3.5 of the OS, this limitation was
system-wide.   From what you've said, and from others have said, it
should be process-specific.  That is,  I should be able to create 
more than one process less than 2.5MB in size.  Correct?

  I can't.  Even statically allocating I can only get to about 2.4Megs.

  Try this for me please:

_0) compile the following on your 3b1.  (hope this works from memory)

/*---------------------cut here-----------------*/
/* memhog.c --- chew up 5 Megs of memory.       */
#include <stdio.h>
#include <errno.h>

#define NUNITS 5000
#define UNITSZ 1024

char   bigarray[NUNITS][UNITSZ];  /* allocate 5 Megs */

void main()
{

  sleep(180);	/* sleep for three minutes, testing time */

}
/*---------------------cut here-----------------*/


  It allocates a 5meg chunk of memory statically.

_1)  Run the following (I used a loop in tcsh but I'll assume sh 
for portability).

#---------------------cut here------------------#
#  chewmem.sh --- run 6 copies of 5Meg memhogs  #
#
./memhog &
./memhog &
./memhog &
./memhog &
./memhog &
./memhog &
#
#   see how many are running
ps -el
#
#---------------------cut here------------------#


(Another idea is to write a set of programs that use sbrk to 
increase the brk size.  Again I got the 2.5Meg limitation.  
I'll have to try that again with multiple processes.)

_2)  Email me and let me know:
	a) your OS version (ls -al /UNIX*)
	b) physical memory (seen at boot time)
	c) swap size (df /dev/swap  or df /dev/fp001)
	d) the number of memhogs you can run at one time.
	e) anything else that is significant.



Why???  Perhaps 3.5 is the problem.  Perhaps this restriction will
go away with 3.51m.  I sure hope so.  In any event, this will help 
me sleep at night.  After all, why did I buy that extra 1.5Megs of 
memory if my total data segment SYSTEM-WIDE cannot exceed 2.5Megs?


FYI:  I have 5 Megs of swap and 3.5Megs of core.  Even with 2 Megs 
in use for other stuff, I should be able to swap and allocate 
6.5Megs more.  

Thanks...




Newsgroups: comp.sys.3b1