8.47  DEFSTORE  (Display  or  define  main  and  expanded  storage  
values)  
8.47.1 Function
The  DEFSTORE  command  is  used  to  specify  the  size  of  the  main  and  expanded  storage.  Given  without  
an  argument  the  DEFSTORE  command  displays  the  current  size  of  the  main  and  expanded  storage.  If  
only  the  type  of  storage  is  given,  the  current  storage  size  of  this  type  is  displayed.  Storage  is  allocated  in  
megabytes,  unless  a  specific  unit  is  specified.  The  actual  upper  limit  of  the  main  and  expanded  storage  is  
determined  by  the  host  system's  architecture,  operating  system,  and  on  some  systems  the  amount  of  
physical  memory  and  paging  space  you  have  available.  
The  practical  limit  depends  on  the  maximum  amount  of  storage  that  can  be  obtained  by  the  “malloc”  
function  (usually  around  1  GB  on  32-bit  platforms;  on  64-bit  platforms  the  value  should  only  be  limited  by  
available  paging  space).  
When  increasing  the  storage  size  Hercules  attempts  to  allocate  first  the  new  storage.  If  the  new  allocation  
is  successful  then  the  previously  allocated  memory  will  be  freed.  This  is  to  prevent  a  situation  where  the  
old  memory  is  freed  first,  then  the  new  allocation  fails  and  a  reallocation  of  the  memory  in  the  previous  
size  also  fails  because  of  storage  fragmentation  and  therefore  leaving  Hercules  without  memory.  
When  decreasing  the  storage  the  memory  will  stay  allocated  in  the  previous  size  but  the  storage  size  will  
appear  as  decreased.  Subsequent  increases  will  not  reallocate  memory  unless  they  go  over  the  already  
allocated  amount.  
An  additional  optional  argument  determines  the  locking  state  of  the  allocated  memory  (page  lock  by  host  
operating  system).  The  LOCKED  option  indicates  that  the  memory  is  to  be  locked  into  storage  while  UN-  
LOCKED  (the  default)  indicates  that  the  memory  is  not  locked  into  the  storage.  
Please  note  that  Hercules  preserves  the  last  locking  state  of  DEFSTORE  for  each  type  of  storage.  Once  
the  storage  is  locked,  any  subsequent  change  to  the  storage  size  will  honor  the  existing  lock  state  of  me-  
mory  unless  the  lock  state  is  specified  again  on  the  DEFSTORE  command.  
Caution:  Do  not  lock  storage  unless  sufficient  real  memory  is  available  to  back  up  the  request.  Failure  to  
do  so  may  require  the  host  system  to  be  rebooted.  
8.47.2 Syntax
Descriptive  
msize[  ]  [  
xsize[  ]  [  
Diagram  
¬¬ ¬¬¬¬¬¬¬¬¬¬¬§¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬¬ÊÍ
¬¬  
«  
storagetype  
            
            



















































































































































































































































































































































































































































































































































































































































































