cQGMHEAP ;GMHEAP Memory requirement calculator ; ; Author: Mark Bolinsky ; Date: 3/22/2004 ; Purpose: This utility will provide a minimum recommended ; value based on current/active configuration file ; ; 2005-01-18: Added support for shadowing changes in 5.0.13+ ; 2005-01-18: Added support for calling as a function ; D VERSION ;I 'ok50 w !!,"This utility is for versions 5.0 and above." h 3 k ok50 q ; BEGIN s conf=$p($zu(86),"*",1),dbcnt=0,shad=0,batch=0 w !,"This utility will examine you current/active configuration file,",! w "and will provide a minimum recommended value." w !!,"NOTE: If running Cache' 5.0.13 and higher, the 'GMHEAP' recommended value",! w "will be increased signficantly compared to earlier versions of Cache' to",! w "accommodate performance enhancements." w !!,"*** Using configuration file name: ",conf d calc d report q ; BACK(x) ; Entry point for calling as a function and returning value i '$d(ok50) d VERSION ;q 0 s conf=$p($zu(86),"*",1),dbcnt=0,shad=0,batch=1 d calc s misc=2000000 ; include additional overhead for Class Control Blocks s minsiz=(locksiz*1.5)+$G(nsptbl,32768)+$G(slmtbl,2097152)+(128*maxpid)+(256*dbcnt)+misc i ok50 d ; . i (ok50) & (shad=1) & ($ZBITLEN($ZVERSION(0))>=25) d ; .. i ($ZBITGET($ZVERSION(0),25)=1) & ($system.Version.GetMajor()=5) & ($system.Version.GetPoint()>=13) d ... s minsiz=minsiz+8388608 ; add 8MB for shadowing ... ; add additional 2MB for each CPU over 4 CPUs ... i $system.Util.NumberOfCPUs()>4 s minsiz=minsiz+(($system.Util.NumberOfCPUs()-4)*2097152) q $fn(minsiz/1024,"",0) ; calc S $zt="end^"_$T(+0) s maxpid=$G(^|"%SYS"|SYS("LASTMAXPID")) o conf:("R"):5 i '$t w !!,"Can't open configuration file" q f u conf r x q:$zeof d . i $p(x,"=",1)="gmheap" u 0 i 'batch w !!,"Current GMHEAP size = ",$p(x,"=",2)_" KB" q . i $p(x,"=",1)="locksiz" s locksiz=$p(x,"=",2) q . i $p(x,"=",1)="implheap" s nsptbl=$p($p(x,"=",2),",",1) s slmtbl=$p($p(x,"=",2),",",2) q . i $p(x,"=",1)="nlstab" s nlstbl=$p(x,"=",2) q . i $e($p(x,"=",1),1,7)="DataSet" s dbcnt=dbcnt+1 . i $p(x,"=",1)="processes" s maxpid=$p($p(x,"=",2),",",1) . i $p(x,"=",1)="CLI_1" s shad=1 . q c conf q ; report ;i batch=0 q s misc=2000000 ; include additional overhead for Class Control Blocks s minsiz=(locksiz*1.5)+$G(nsptbl,32768)+$G(slmtbl,2097152)+(128*maxpid)+(256*dbcnt)+misc i ok50 d ; . i (shad=1) & ($ZBITLEN($ZVERSION(0))>=25) d . . i ($ZBITGET($ZVERSION(0),25)=1) & ($system.Version.GetMajor()=5) & ($system.Version.GetPoint()>=13) d . . . s minsiz=minsiz+8388608 ; add 8MB for shadowing . . . ; add additional 2MB for each CPU over 4 CPUs . . . i $system.Util.NumberOfCPUs()>4 s minsiz=minsiz+(($system.Util.NumberOfCPUs()-4)*2097152) w !,"Recommended minimum GMHEAP size: ",$fn(minsiz/1024,"",0)," KB",! q ; end ; c conf i $ZE["ENDOFFILE" q w !,"An error occured: ",$ze VERSION ; Check version s $ZT="VERSIONerr^"_$T(+0),ok50=0 i ($ZBITGET($ZVERSION(0),25)=1) & ($system.Version.GetMajor()>=5) S ok50=1 q VERSIONerr ; Not running 5.0, so we will quit q ; ZZ ; 17.01.2012 - 15:58 * Cache-r6.4.9