Skip to Content

RLV Memory Management and Monitoring

In Memory row-level feature is available in SAP IQ 16.  This feature allows more than one user to update same table concurrenlty as long as they are adding or modifying different rows. You will need to configure IQ server with additional memory for RLV store ie. in addition to main cache, temp cache adn size of large memory pool, you will need need additional memory for RLV store.

RLV memory can be configured wtih startup switch -iqrlvmem (default 2G).

# iqdemo.cfg

# ------------------------------------------------------------

# Default startup parameters for the ASIQ demo database

# ------------------------------------------------------------

-n  iq1602

-x  tcpip{port=9447}

# The following parameters are also found in the configuration file

# /usr/sybase/rel16_iq_sp02/IQ-16_0/scripts/default.cfg.  Any parameters not specified below

# and not in the start up parameter list, will be added by start_iq

# using default.cfg as a guide.

-c  512m

-gc 20

-gd all

-gl all

-gm 10

-gp 4096

-iqmc 2000

-iqtc 2000

-zr sql

-iqrlvmem 4096

sa_server_option SA system procedure can be used to increase RLV memory dynamically:

   sa_server_option 'RLV_memory_mb', 8192

  This will configure RLV store size to 8192MB

  RLV memory usage depends on several factors:

  •   Table Schema(number of fixed and variable length columns and width of the columns)
  •   Concurrent loads and amount of data being loaded
  •    Number of cores
  •    Merge frequency

Every single RLV enabled table will require an in-memory table to hold its data. The memory requirement of this RLV store will change during the life of the table while it is RLV enabled. The initial size of RLV store needed during first DML can be calculated approximately using following formula:

#COLS = #columns + 1 (pseudo column)

Base RLVstore (BRS) = ( Initial setup of the RLV store )

                BRS ~= (#COLS)  x 16MB

Fixed datatypes of a subfragment uses default 16MB to store data in the RLV store. Variable datatypes uses default 512KB and bit datatypes uses 128KB default size.


             Number of Cores=4

             Number of Columns=303

             RLV memory can be approximately calculated using:


             for Singleton insert using only 1 core,  RLV memory used:

                   16mb *1*303= ~4.8GB

     Data is store in table fragment. Each table fragments is further subdivided into subfragments. Multiple table versions of the table fragments may be required to handle multiple transactions. Each table version will have the RLV memory size requirement of at least equal to this BRS(Base RLV Store). Multiple transactions will create multiple table store versions that need to be stored in memory simultaneously. Multiple table versions can quickly increase the memory requirement of the RLV enabled table. Old transactions can hold onto old references to the in-memory store whch will also consume memory.

  RLV Out Of Memory Errors:


Exception Thrown from rvlib/rv_TabStoren.cxx:178, Err#5, tid 3227 origtid 3227

O/S Err#: 0,ErrID: 15008 (rv_PersistenceException); SQLCode: -1013129, SQLState: 'QRLV1',Severity: 14

[22159]: RLVStore has run out of memory Exception Thrown from rvlib/rv_TabStoren.cxx:178, Err# 5, tid 3 origtid 3227

O/S Err#: 0, ErrID: 15008 (rv_PersistenceException); SQLCode: -1013129, SQLState: 'QRLV1', Severity: 14

   Explanation A:

              - To much data is being modified/ added by RLV transactions at once  

           -  Reduce the size of update/inserts and increase frequency of commits to  keep amount of data modified/transaction.

  Explanation B:  
          - Automated merge is not able to keep up with RLV workload

           - Review RLV merger  history table(SYSIQRLVMERGEHISTORY)
               - Adjust the automated merger period(RV_AUTO_MERGE_EVAL_INTERVAL)

               -  Adjust automated thresholds, RV_MERGE_TABLE_NUMROWS,     RV_MERGE_TABLE_MEMPERCENT, and RV_MERGE_NODE_MEMSIZE  RLV Options.



                   - Maximum RLV memory configure too low.

                   -increase maximum RLV memory using server startup switch –iqrlvmem


                   -increase maximum RLV memory using sa_server_option

                        sa_server_option  ‘rlv_memory_mb’, <max MB>

                  - issue manual merge to free of RLV memory using

                      sp_iqmergerlvstore (merge_type, table_name, [table_owner])

Note: if low or out of memory , then issue blocking merge, as non-blocking merge needs to setup additional  in-memory table fragments, which won’t be
possible,if already low/out of memory



  •     Use sp_iqrlvmemory system stored procedure to monitor RLV memory usage per table.


   (DBA)> sp_iqrlvmemory

    table_id  fragments      total       data dictionary     bitmap


      1089          1          6          0          3          2

       822          1         64         64          1          1

   (2 rows)

  •     Use sp_iqstatus system stored  procedure to monitor memory used by the RLV store


    (DBA)> select * from sp_iqstatus() where name like '%RLV%'




    RLV memory limit:


    RLV memory used:




   (2 rows)


No comments