record managerI have seen and heard many presentations on Oracle Forms 12c new features. They all mention GET_RECMGR_STATS as a new feature, but so far have yet to see anyone use this new built-in. To start the ball rolling I created a simple form to see what is returned in the 6 new variables that are mentioned in the presentations.

 

GET_RECMGR_STATS, as the name implies, gets information about the record manager, in particularly, the memory used by the Record Manager. To date the Forms Record Manager was always treated as a black box. For me, this has always been star of the Forms show. All data manipulation and editing goes through this Record Manager. For those familiar with writing code to create, retrieve, update and delete (CRUD) ¬†records you will have found that Forms has forever managed the these functions for you, without writing a line of code. This really was the early form of MVC, where the ‘Model’ part was managed for you, these days it seems to me that developers want more control and have extracted the M part from the black box. Probably for discussion. Anyway, Forms has always removed the need to worry about CRUD. The Record Manager black box is now being gently exposed to developers. Not that you can manipulate how the black box works, but you can start to see how memory is used in the black box. I am surprised that this functionality has appeared now. Years ago, memory was so much more valuable and limiting, today a few more GB of memory installed in the middleware server is not a huge problem. Nonetheless, its good to see enhancements going into Oracle Forms.

The procedure is very straightforward to use, unless someone corrects me! I created  a procedure that populates a set of display only fields in a Forms canvas that I used to monitor various operations on the Form module. There are four types of Record Manager stats. ALL_RECOD_DATA which is the sum of ARCHIVED_RECORD_DATA+ACTIVE_RECORD_DATA+RECORD_ANCHORS.

PROCEDURE GET_RECORD_MANAGER_STATS IS

 

BEGIN

get_recmgr_stats(ALL_RECORD_DATA);

:item1 := :system.recmgr_mapped;

:item2 := :system.recmgr_malloced;

:item3 := :system.recmgr_mapped_in_use;

:item4 := :system.recmgr_mapped_reserved;

:item5 := :system.recmgr_written;

:item6 := :system.recmgr_written_in_use;

 

get_recmgr_stats(ARCHIVED_RECORD_DATA); :

item37 := :system.recmgr_mapped; :

item38 := :system.recmgr_malloced; :

item39 := :system.recmgr_mapped_in_use;

:item40 := :system.recmgr_mapped_reserved;

:item41 := :system.recmgr_written;

:item42 := :system.recmgr_written_in_use;

 

get_recmgr_stats(ACTIVE_RECORD_DATA);

:item50 := :system.recmgr_mapped;

:item51 := :system.recmgr_malloced;

:item52 := :system.recmgr_mapped_in_use;

:item53 := :system.recmgr_mapped_reserved;

:item54 := :system.recmgr_written;

:item55 := :system.recmgr_written_in_use;

 

get_recmgr_stats(RECORD_ANCHORS);

:item57 := :system.recmgr_mapped;

:item58 := :system.recmgr_malloced;

:item59 := :system.recmgr_mapped_in_use;

:item60 := :system.recmgr_mapped_reserved;

:item61 := :system.recmgr_written;

:item62 := :system.recmgr_written_in_use;

END;

You can look the individual items up in the help file, but to summarise:-

  • recmgr_mapped – allocated memory by mmap or VirtualAlloc
  • recmgr_malloced – Allocated memory (long time since my C programming days!)
  • recmgr_mapped_in_use – Mapped data that is currently in use
  • recmgr_mapped_reserved – Reserved swap space or file system memory
  • recmgr_written – absent from help
  • recmgr_written_in_use – absemt from help

This built in will also write Forms messages to the log file if in debug mode. Have a look at FRM 91990 to FRM-91995 for the meanings.

WIth a simple form with 5 blocks I had the following output. The trick now is to interpret the data, but only if you think you are having memory issues… comments welcome.

get_recmgr_stats