Salesforce

Will moving large pieces of R-code into a shared memory procedure library reduce the memory footprint

« Go Back

Information

 
TitleWill moving large pieces of R-code into a shared memory procedure library reduce the memory footprint
URL NameP182768
Article Number000147218
EnvironmentProduct: OpenEdge
Version: 10.x, 11.x
OS: All Supported Platforms
Question/Problem Description
Can I stop excessive client memory consumption by moving large pieces of R-code into a shared memory procedure library?
Will using a shared memory procedure library for a single program that all clients run persistently at application startup save any memory?
Does it make sense to use a shared memory procedure library for a single large piece of R-code?
Does the size of the R-code when moved into a shared memory procedure library correlate to a reduction in the memory consumption of each client?
Steps to Reproduce
Clarifying Information
Error Message
Defect Number
Enhancement Number
Cause
Resolution
In most cases, using a shared memory procedure library instead of a normal procedure library will provide some benefit:
  • For a normal procedure library the AVM will try to load the entire internal directory of the procedure library into private (local) memory. Depending on how many programs are stored in the procedure library the entire directory may require a substantial amount of memory. Unless the -plm startup parameter is used, which loads part of the directory in a 512 bytes cache instead but also slows down library access.
  • For a shared memory procedure library we do not load the internal directory into local memory, it will be accessed via shared memory instead. When if multiple clients use the library at the same time, each client requires less private memory and overall memory use on the machine decreases.
  • For further detail refer to Article  How does using memory mapped shared libraries affect performance ? 

Specific to the memory consumption of the large piece of R-code, using a shared memory procedure library will behave differently over a normal procedure library:
  • For a normal procedure library, different segments are not all loaded into private memory (-mmax pool) at once. Only the segments that are actually needed will be loaded. For example, each internal procedure is contained in its own action segment and if an internal procedure is not invoked its action segment will never be loaded into local memory. 
  • For a memory-mapped library, different segments of the R-code are accessed directly from the shared memory and are not loaded into local memory (-mmax) at all. Except starting with OpenEdge 10.2B, Text segments will be loaded into -mmax pool and codepage-converted if the R-code codepage doesn't match the current session's codepages. For further detail refer to Article  Cannot use memory-mapped procedure library if r-code codepage doesn't match -cpinternal   

Simply placing a large multi-megabyte piece of R-code into a shared memory procedure library does not necessarily correlate to a large reduction in memory consumption for each client (AppServer Agent, WebSpeed Agent, _progress, _prowin)
The memory footprint gain is limited to which parts of the R-code the client would load into private memory simultaneously, which depends on the application logic.
Workaround
Notes
References to Other Documentation:

OpenEdge Deployment: Managing ABL Applications, Chapter 6, Managing Procedure Libraries
OpenEdge Deployment: Managing ABL Applications, Appendix B, R-code Features and Functions

Progress Articles:

 Why and how to use a procedure library
 How does using memory mapped shared libraries affect performance ?
 Cannot use memory-mapped procedure library if r-code codepage doesn't match -cpinternal
 Managing Memory within the ABL?
Keyword Phrase
Last Modified Date11/20/2020 7:19 AM

Powered by