Salesforce

Excessive memory usage parsing JSON object

« Go Back

Information

 
TitleExcessive memory usage parsing JSON object
URL NameExcessive-memory-usage-parsing-JSON-object
Article Number000120367
EnvironmentProduct: OpenEdge
Version: 11.6.x, 11.7.x
OS: All supported platforms
Question/Problem Description
Excessive memory usage parsing JSON object

Parsing a 3 MB JSON file with ObjectModelParser:ParseFile() causes the Progress client process to consume more than 40 MB
Loading a large JSON object through the JSON ObjectModelParser, massively increases the Progress Clients memory consumption.

When loading a large JSON object through the JSON ObjectModelParser, the client's memory process massively increases

The read data can be several MB large, however the process size of of the client ( prowin, _progres, _proapsv, _mproapsv ) can grow up to several GB, which causes further problems when the machine has limited remaining RAM available including dbdown scenarios.

After the data object has been deleted or written to file, the client still maintains a reasonable memory size.
Even when the object used to write the file has been deleted, the progress client does not release memory.
Steps to Reproduce
Clarifying Information
Error Message
Defect NumberDefect PSC00361837
Enhancement Number
Cause
In OpenEdge 11.6 and 11.7, there is a memory leak issue with Progress Clients (_progres, _proapsv, prowin) when using JSON objects

The underlying built-in classes inefficiently store JSON objects in memory:
  • The memory usage is unrelated to the HTTP client code, but instead is the cost of creating the JSON object. 
  • For each node in the JSON object, we are creating a new storage pool is created with the intention of being able to contain all the details of that node in the one place, which can be disposed together. 
  • The minimum size of the pool is 8KB, no matter how small the amount of memory is needed.
  • Since the memory usage of the JSON node is small, most of this 8 KB memory space is not used which means a JSON object can consume considerably more memory than the JSON text. 
  • For example: A minimal node for a JSON object that contains only other JSON objects is around 224 bytes, which means that more than 7KB was allocated but never used.
  • JSON objects do not share a common storage pool for the JSON "document". Each individual JSON object within the larger JSON object uses 8KB, which quickly consumes memory.
Resolution
Upgrade to OpenEdge 11.7.3, 12.0 where the memory leak has been fixed by re-designing the way JSON objects are stored in memory with 256 byte storage pool instead of 8 KB.

Alternatively this issue is included the following Generally Available Hotfixes:
  • OpenEdge 11.7.1.009
  • OpenEdge 11.7.2.004

 
Workaround
Notes
Keyword Phrase
Last Modified Date10/23/2019 9:31 AM

Powered by