Skip to main content
Doc Ruckel
Participating Frequently
May 28, 2025 9:30 AM UTC

Maximizing RAM use



------------------------------
Doc Ruckel
Part time programmer
Rocket Forum Shared Account
------------------------------

    9 replies

    John Jenkins
    Participating Frequently
    May 28, 2025 8:23 PM UTC


    ------------------------------
    Doc Ruckel
    Part time programmer
    Rocket Forum Shared Account
    ------------------------------

    Doc

    If the database does not need it then why throw more memory at a process? Multivalue databases are pretty efficient of memory usage. Its probably better use of memory to increase disk cache size. You could also look at how much activity there is in the UniVerse TEMP (UVTEMP) directory and if it's busy then put it on ramdisk.

    Rocket Professional Services can offer system and application-specific tuning advice if you wish - though there is a cost - see https://www.rocketsoftware.com/en-us/insights/multivalue-system-healthcheck. 


    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------

    JJ
    Doc Ruckel
    Participating Frequently
    May 29, 2025 9:34 AM UTC

    Doc

    If the database does not need it then why throw more memory at a process? Multivalue databases are pretty efficient of memory usage. Its probably better use of memory to increase disk cache size. You could also look at how much activity there is in the UniVerse TEMP (UVTEMP) directory and if it's busy then put it on ramdisk.

    Rocket Professional Services can offer system and application-specific tuning advice if you wish - though there is a cost - see https://www.rocketsoftware.com/en-us/insights/multivalue-system-healthcheck. 


    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------

    Thank you, JJ!

    ~Doc



    ------------------------------
    Doc Ruckel
    Part time programmer
    Rocket Forum Shared Account
    ------------------------------
    ~Doc
    Manu Fernandes
    Inspiring
    May 30, 2025 6:10 AM UTC


    ------------------------------
    Doc Ruckel
    Part time programmer
    Rocket Forum Shared Account
    ------------------------------

    Hello,
    I'm sharing my regular tips for optimizing a Universe environment on Windows Server.

    at disk level

    • use RAID10 (mirror + stripping) for physical configuration of your disks 
    • use disk C: for OS
    • use disk P: for pagefile.sys (>=3x ram size on a m.2 disk) and UVTEMP aka. %UVTEMP%
    • use disk U: for UV aka. %uvhome%, %uvbin% and all your secondary binaries you invoke from your app
    • use disk L: for logs, logging, audit, uvbackups, and file sharing with users (export, import, edi, hold, ...), etc... 
    • use dedicated disk D: for database's accounts aka. %uvdb%, format it with NFS, set the cluster (allocation unit) to 4096 (! 4096/512=8 -> separator = 8)

    at windows level

    • set : computer / manage/avanced/performance/advanced = best performance for background process
    • set : virtual memory(pagefile.sys) to maximize disk swap in memory
      • Minimum size: 1.5 times the available RAM
      • Maximum size: 3 times the available RAM
      • Custom configurations: Adjust based on workload requirements, ensuring the Pagefile resides on a fast storage medium (e.g., M.", SSD instead of HDD) for optimal performance.
    • set antivirus to exclude %UVDB%, %UVTEMP%

    at uv level :

    set uv and uvprocess to use more memories

    uvconfig

    • MFILES -> push to open all your files and avoid rotating file; I use 3000
    • TXMEM ; if you have large transaction ; you can avoid swap to UVTEMP; I use 1000 (1000kb = 1mb)
    • SELBUF ; to avoid swap large selectlist to UVTEMP ; I use 1000 (1000kb = 1mb)
    • UVTEMP -> into a quick disk
    • set log, logging, audit, etc, ...  paths to the secondary disk L:

    if possible use (with uv 12+) RFS ON, where the I/O are not done by the user session (uvsh, uvapi_slave) process but in-memory by secondary processing and paging mechanims.

    maintenance

    • perform RESIZING on regular basis
    • always use the Separator to a value equal to the hdd's cluster (8) or multiple of it (16, 32, 64, ...)
    • prefer distributed files (DEFINE.DF) versus large large 64 bit files; it's more easy to manage/optimize 10 files x 1gb than 1 file of 10gb

    basics

    • open all your files into a COMMON and share the COMMON with all your program/subr.

    I suggest to write a IO(verb,record,file,key,options) function to centralize all your disk access. like :

    (This sample can be far more complete !)

    FUNCTION IO(verb,record,file,key,options) 
    COMMON /IO/ FILENAMES,LAST.STATUS,FILEVARS(1)
    LAST.STATUS = ''
    LOCATE(file,FILENAMES;RG) THEN 
        FV = FILEVARS(RG) 
    END ELSE 
        OPEN file TO FV ELSE result = 0 ; LAST.STATUS = status() 
        if RG > INMAT(FILEVARS) then DIM FILEVARS(RG + 100) ;* add 100 dimensions 
        FILENAMES<RG> = file ;  FILEVARS(RG) = FV 
    END 
    IF LAST.STATUS = '' THEN 
        ON verb GOSUB doREAD, doREADV, doWRITE,...,doSTATUS, doRECORDLOCKED,...
    END 
    
    return (result)
    *-----------------------
    doREAD:
        READ record FROM FV,key THEN result = 1 ELSE result = 0 
        return  
    
    doREADV:
        READ record FROM FV,key,options THEN result = 1 ELSE result = 0 
        return  
    
    doWRITE:
        WRITE record ON file,key ... 
        return  
    
    doSTATUS:
        result = LAST.STATUS
        return  
    doRECORDLOCKED:
        ... 
        return
    doFILEINFO:
    return
    do...
    return *-----------------------

    prepare a include to incorporate the IO Function and Equates into the code

    BP IO.H 
    DEFFUN IO(verb,record,file,key,options) calling "*IO* 
    EQU IO$READ TO 1 , IO$READV TO 2, ... 
    

    and use regex search/replace (or write a basic) to include BP IO.H and refactor your READ|WRITE rec FROM file,key into  IF IO(IO$READ/WRITE,file,key,record,'') or READV|WRITEV rec FROM file,key,vm into IF IO(IO$READV|WRITEV,file,key,record,vm)

    For sure, you can do it only at the OPEN level and create a myOPEN subr/func, I like the encapsulation of read/write/info verbs then I can easily add logs, warnings or change the logic of the access. 

    I hope this help.



    ------------------------------
    Manu Fernandes
    ------------------------------
    New Participant
    Jun 2, 2025 4:52 PM UTC

    Hello,
    I'm sharing my regular tips for optimizing a Universe environment on Windows Server.

    at disk level

    • use RAID10 (mirror + stripping) for physical configuration of your disks 
    • use disk C: for OS
    • use disk P: for pagefile.sys (>=3x ram size on a m.2 disk) and UVTEMP aka. %UVTEMP%
    • use disk U: for UV aka. %uvhome%, %uvbin% and all your secondary binaries you invoke from your app
    • use disk L: for logs, logging, audit, uvbackups, and file sharing with users (export, import, edi, hold, ...), etc... 
    • use dedicated disk D: for database's accounts aka. %uvdb%, format it with NFS, set the cluster (allocation unit) to 4096 (! 4096/512=8 -> separator = 8)

    at windows level

    • set : computer / manage/avanced/performance/advanced = best performance for background process
    • set : virtual memory(pagefile.sys) to maximize disk swap in memory
      • Minimum size: 1.5 times the available RAM
      • Maximum size: 3 times the available RAM
      • Custom configurations: Adjust based on workload requirements, ensuring the Pagefile resides on a fast storage medium (e.g., M.", SSD instead of HDD) for optimal performance.
    • set antivirus to exclude %UVDB%, %UVTEMP%

    at uv level :

    set uv and uvprocess to use more memories

    uvconfig

    • MFILES -> push to open all your files and avoid rotating file; I use 3000
    • TXMEM ; if you have large transaction ; you can avoid swap to UVTEMP; I use 1000 (1000kb = 1mb)
    • SELBUF ; to avoid swap large selectlist to UVTEMP ; I use 1000 (1000kb = 1mb)
    • UVTEMP -> into a quick disk
    • set log, logging, audit, etc, ...  paths to the secondary disk L:

    if possible use (with uv 12+) RFS ON, where the I/O are not done by the user session (uvsh, uvapi_slave) process but in-memory by secondary processing and paging mechanims.

    maintenance

    • perform RESIZING on regular basis
    • always use the Separator to a value equal to the hdd's cluster (8) or multiple of it (16, 32, 64, ...)
    • prefer distributed files (DEFINE.DF) versus large large 64 bit files; it's more easy to manage/optimize 10 files x 1gb than 1 file of 10gb

    basics

    • open all your files into a COMMON and share the COMMON with all your program/subr.

    I suggest to write a IO(verb,record,file,key,options) function to centralize all your disk access. like :

    (This sample can be far more complete !)

    FUNCTION IO(verb,record,file,key,options) 
    COMMON /IO/ FILENAMES,LAST.STATUS,FILEVARS(1)
    LAST.STATUS = ''
    LOCATE(file,FILENAMES;RG) THEN 
        FV = FILEVARS(RG) 
    END ELSE 
        OPEN file TO FV ELSE result = 0 ; LAST.STATUS = status() 
        if RG > INMAT(FILEVARS) then DIM FILEVARS(RG + 100) ;* add 100 dimensions 
        FILENAMES<RG> = file ;  FILEVARS(RG) = FV 
    END 
    IF LAST.STATUS = '' THEN 
        ON verb GOSUB doREAD, doREADV, doWRITE,...,doSTATUS, doRECORDLOCKED,...
    END 
    
    return (result)
    *-----------------------
    doREAD:
        READ record FROM FV,key THEN result = 1 ELSE result = 0 
        return  
    
    doREADV:
        READ record FROM FV,key,options THEN result = 1 ELSE result = 0 
        return  
    
    doWRITE:
        WRITE record ON file,key ... 
        return  
    
    doSTATUS:
        result = LAST.STATUS
        return  
    doRECORDLOCKED:
        ... 
        return
    doFILEINFO:
    return
    do...
    return *-----------------------

    prepare a include to incorporate the IO Function and Equates into the code

    BP IO.H 
    DEFFUN IO(verb,record,file,key,options) calling "*IO* 
    EQU IO$READ TO 1 , IO$READV TO 2, ... 
    

    and use regex search/replace (or write a basic) to include BP IO.H and refactor your READ|WRITE rec FROM file,key into  IF IO(IO$READ/WRITE,file,key,record,'') or READV|WRITEV rec FROM file,key,vm into IF IO(IO$READV|WRITEV,file,key,record,vm)

    For sure, you can do it only at the OPEN level and create a myOPEN subr/func, I like the encapsulation of read/write/info verbs then I can easily add logs, warnings or change the logic of the access. 

    I hope this help.



    ------------------------------
    Manu Fernandes
    ------------------------------

    Hi Manu,

     

    Thank you for the Universe optimization post.

    I believe Universe provides the named common functionality for opening files.

     

    Here is how I open files in Universe:

     

    call *OPEN$UV$FILE("", "APBATCH", fileAPBATCH, "fileAPBATCH")

    if @user.return.code eq 0 then programMessage = "NO APBATCH FILE" ; errorCode = FILE.OPEN.FAIL ; return

    OPEN$UV$FILE is in the APP.PROGS directory.



    ------------------------------
    Ross Craig
    Information Systems Manager
    Northern Lights Inc
    Seattle WA US
    ------------------------------
    John Jenkins
    Participating Frequently
    Jun 4, 2025 2:29 PM UTC

    Hello,
    I'm sharing my regular tips for optimizing a Universe environment on Windows Server.

    at disk level

    • use RAID10 (mirror + stripping) for physical configuration of your disks 
    • use disk C: for OS
    • use disk P: for pagefile.sys (>=3x ram size on a m.2 disk) and UVTEMP aka. %UVTEMP%
    • use disk U: for UV aka. %uvhome%, %uvbin% and all your secondary binaries you invoke from your app
    • use disk L: for logs, logging, audit, uvbackups, and file sharing with users (export, import, edi, hold, ...), etc... 
    • use dedicated disk D: for database's accounts aka. %uvdb%, format it with NFS, set the cluster (allocation unit) to 4096 (! 4096/512=8 -> separator = 8)

    at windows level

    • set : computer / manage/avanced/performance/advanced = best performance for background process
    • set : virtual memory(pagefile.sys) to maximize disk swap in memory
      • Minimum size: 1.5 times the available RAM
      • Maximum size: 3 times the available RAM
      • Custom configurations: Adjust based on workload requirements, ensuring the Pagefile resides on a fast storage medium (e.g., M.", SSD instead of HDD) for optimal performance.
    • set antivirus to exclude %UVDB%, %UVTEMP%

    at uv level :

    set uv and uvprocess to use more memories

    uvconfig

    • MFILES -> push to open all your files and avoid rotating file; I use 3000
    • TXMEM ; if you have large transaction ; you can avoid swap to UVTEMP; I use 1000 (1000kb = 1mb)
    • SELBUF ; to avoid swap large selectlist to UVTEMP ; I use 1000 (1000kb = 1mb)
    • UVTEMP -> into a quick disk
    • set log, logging, audit, etc, ...  paths to the secondary disk L:

    if possible use (with uv 12+) RFS ON, where the I/O are not done by the user session (uvsh, uvapi_slave) process but in-memory by secondary processing and paging mechanims.

    maintenance

    • perform RESIZING on regular basis
    • always use the Separator to a value equal to the hdd's cluster (8) or multiple of it (16, 32, 64, ...)
    • prefer distributed files (DEFINE.DF) versus large large 64 bit files; it's more easy to manage/optimize 10 files x 1gb than 1 file of 10gb

    basics

    • open all your files into a COMMON and share the COMMON with all your program/subr.

    I suggest to write a IO(verb,record,file,key,options) function to centralize all your disk access. like :

    (This sample can be far more complete !)

    FUNCTION IO(verb,record,file,key,options) 
    COMMON /IO/ FILENAMES,LAST.STATUS,FILEVARS(1)
    LAST.STATUS = ''
    LOCATE(file,FILENAMES;RG) THEN 
        FV = FILEVARS(RG) 
    END ELSE 
        OPEN file TO FV ELSE result = 0 ; LAST.STATUS = status() 
        if RG > INMAT(FILEVARS) then DIM FILEVARS(RG + 100) ;* add 100 dimensions 
        FILENAMES<RG> = file ;  FILEVARS(RG) = FV 
    END 
    IF LAST.STATUS = '' THEN 
        ON verb GOSUB doREAD, doREADV, doWRITE,...,doSTATUS, doRECORDLOCKED,...
    END 
    
    return (result)
    *-----------------------
    doREAD:
        READ record FROM FV,key THEN result = 1 ELSE result = 0 
        return  
    
    doREADV:
        READ record FROM FV,key,options THEN result = 1 ELSE result = 0 
        return  
    
    doWRITE:
        WRITE record ON file,key ... 
        return  
    
    doSTATUS:
        result = LAST.STATUS
        return  
    doRECORDLOCKED:
        ... 
        return
    doFILEINFO:
    return
    do...
    return *-----------------------

    prepare a include to incorporate the IO Function and Equates into the code

    BP IO.H 
    DEFFUN IO(verb,record,file,key,options) calling "*IO* 
    EQU IO$READ TO 1 , IO$READV TO 2, ... 
    

    and use regex search/replace (or write a basic) to include BP IO.H and refactor your READ|WRITE rec FROM file,key into  IF IO(IO$READ/WRITE,file,key,record,'') or READV|WRITEV rec FROM file,key,vm into IF IO(IO$READV|WRITEV,file,key,record,vm)

    For sure, you can do it only at the OPEN level and create a myOPEN subr/func, I like the encapsulation of read/write/info verbs then I can easily add logs, warnings or change the logic of the access. 

    I hope this help.



    ------------------------------
    Manu Fernandes
    ------------------------------

    Manu,

    On a busy Windows system with lots of connections being made and dropped (e.g. if using UO with lots of connections and  especially with Connection Pooling) then I recommend dropping the Windows registry setting for the TCP Time Wait Delay to 15 - see https://learn.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance and also increase the number of ephemeral ports https://learn.microsoft.com/en-us/answers/questions/482793/tcp-ip-concurrent-connections

    When connection time delays increase as the connection load/hit-rate increases then these are definitely in the frame. I usually adjust the TCP Time Wait Delay just as a matter of routine. 

    This frees up socket conections after closure much more quickly than the default and can help avoid socket resource exhaustion.

    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------

    JJ
    Darren Johnson
    Participating Frequently
    Jun 5, 2025 7:56 PM UTC

    Manu,

    On a busy Windows system with lots of connections being made and dropped (e.g. if using UO with lots of connections and  especially with Connection Pooling) then I recommend dropping the Windows registry setting for the TCP Time Wait Delay to 15 - see https://learn.microsoft.com/en-us/biztalk/technical-guides/settings-that-can-be-modified-to-improve-network-performance and also increase the number of ephemeral ports https://learn.microsoft.com/en-us/answers/questions/482793/tcp-ip-concurrent-connections

    When connection time delays increase as the connection load/hit-rate increases then these are definitely in the frame. I usually adjust the TCP Time Wait Delay just as a matter of routine. 

    This frees up socket conections after closure much more quickly than the default and can help avoid socket resource exhaustion.

    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------

    Hi John,

    Do you have a version of this for Unidata 8.3 windows server hosted in the Azure cloud.

    Thanks



    ------------------------------
    [Darren] [Johnson] [Australia]
    [Snr Dev Engineer]
    ------------------------------
    Manu Fernandes
    Inspiring
    Jun 6, 2025 12:45 AM UTC

    Hi John,

    Do you have a version of this for Unidata 8.3 windows server hosted in the Azure cloud.

    Thanks



    ------------------------------
    [Darren] [Johnson] [Australia]
    [Snr Dev Engineer]
    ------------------------------

    Hi John, 

    Thank you for the tips, I add it to my checklist. 

    (I'm happy you didn't disagrea with my suggestions. :-)



    ------------------------------
    Manu Fernandes
    ------------------------------
    John Jenkins
    Participating Frequently
    Jun 6, 2025 8:20 AM UTC

    Hi John,

    Do you have a version of this for Unidata 8.3 windows server hosted in the Azure cloud.

    Thanks



    ------------------------------
    [Darren] [Johnson] [Australia]
    [Snr Dev Engineer]
    ------------------------------

    Darren,

    This is a.change in Windows timing and not  database dependent.

     

    Regards

    JJ



    ------------------------------
    John Jenkins
    Thame, Oxfordshire
    ------------------------------
    JJ
    Doc Ruckel
    Participating Frequently
    Jun 9, 2025 2:24 PM UTC

    Hello,
    I'm sharing my regular tips for optimizing a Universe environment on Windows Server.

    at disk level

    • use RAID10 (mirror + stripping) for physical configuration of your disks 
    • use disk C: for OS
    • use disk P: for pagefile.sys (>=3x ram size on a m.2 disk) and UVTEMP aka. %UVTEMP%
    • use disk U: for UV aka. %uvhome%, %uvbin% and all your secondary binaries you invoke from your app
    • use disk L: for logs, logging, audit, uvbackups, and file sharing with users (export, import, edi, hold, ...), etc... 
    • use dedicated disk D: for database's accounts aka. %uvdb%, format it with NFS, set the cluster (allocation unit) to 4096 (! 4096/512=8 -> separator = 8)

    at windows level

    • set : computer / manage/avanced/performance/advanced = best performance for background process
    • set : virtual memory(pagefile.sys) to maximize disk swap in memory
      • Minimum size: 1.5 times the available RAM
      • Maximum size: 3 times the available RAM
      • Custom configurations: Adjust based on workload requirements, ensuring the Pagefile resides on a fast storage medium (e.g., M.", SSD instead of HDD) for optimal performance.
    • set antivirus to exclude %UVDB%, %UVTEMP%

    at uv level :

    set uv and uvprocess to use more memories

    uvconfig

    • MFILES -> push to open all your files and avoid rotating file; I use 3000
    • TXMEM ; if you have large transaction ; you can avoid swap to UVTEMP; I use 1000 (1000kb = 1mb)
    • SELBUF ; to avoid swap large selectlist to UVTEMP ; I use 1000 (1000kb = 1mb)
    • UVTEMP -> into a quick disk
    • set log, logging, audit, etc, ...  paths to the secondary disk L:

    if possible use (with uv 12+) RFS ON, where the I/O are not done by the user session (uvsh, uvapi_slave) process but in-memory by secondary processing and paging mechanims.

    maintenance

    • perform RESIZING on regular basis
    • always use the Separator to a value equal to the hdd's cluster (8) or multiple of it (16, 32, 64, ...)
    • prefer distributed files (DEFINE.DF) versus large large 64 bit files; it's more easy to manage/optimize 10 files x 1gb than 1 file of 10gb

    basics

    • open all your files into a COMMON and share the COMMON with all your program/subr.

    I suggest to write a IO(verb,record,file,key,options) function to centralize all your disk access. like :

    (This sample can be far more complete !)

    FUNCTION IO(verb,record,file,key,options) 
    COMMON /IO/ FILENAMES,LAST.STATUS,FILEVARS(1)
    LAST.STATUS = ''
    LOCATE(file,FILENAMES;RG) THEN 
        FV = FILEVARS(RG) 
    END ELSE 
        OPEN file TO FV ELSE result = 0 ; LAST.STATUS = status() 
        if RG > INMAT(FILEVARS) then DIM FILEVARS(RG + 100) ;* add 100 dimensions 
        FILENAMES<RG> = file ;  FILEVARS(RG) = FV 
    END 
    IF LAST.STATUS = '' THEN 
        ON verb GOSUB doREAD, doREADV, doWRITE,...,doSTATUS, doRECORDLOCKED,...
    END 
    
    return (result)
    *-----------------------
    doREAD:
        READ record FROM FV,key THEN result = 1 ELSE result = 0 
        return  
    
    doREADV:
        READ record FROM FV,key,options THEN result = 1 ELSE result = 0 
        return  
    
    doWRITE:
        WRITE record ON file,key ... 
        return  
    
    doSTATUS:
        result = LAST.STATUS
        return  
    doRECORDLOCKED:
        ... 
        return
    doFILEINFO:
    return
    do...
    return *-----------------------

    prepare a include to incorporate the IO Function and Equates into the code

    BP IO.H 
    DEFFUN IO(verb,record,file,key,options) calling "*IO* 
    EQU IO$READ TO 1 , IO$READV TO 2, ... 
    

    and use regex search/replace (or write a basic) to include BP IO.H and refactor your READ|WRITE rec FROM file,key into  IF IO(IO$READ/WRITE,file,key,record,'') or READV|WRITEV rec FROM file,key,vm into IF IO(IO$READV|WRITEV,file,key,record,vm)

    For sure, you can do it only at the OPEN level and create a myOPEN subr/func, I like the encapsulation of read/write/info verbs then I can easily add logs, warnings or change the logic of the access. 

    I hope this help.



    ------------------------------
    Manu Fernandes
    ------------------------------
    Manu,

    Many thanks for the thorough reply!

    ~Doc
    ~Doc