Performance: only add log record and sql statement to context if trace/debug level <= debug/info

Description

  1. Log records and logged sql statement increase the context size significantly. We don't need that for production and hence should only add that to context if tracelevel is set to INFO and below.

  2. Minor clean up and add synchronized to CLogErrorBuffer.publish method (it needs to be thread safe).

  3. AD_Issue is another source that can add significant overheat to the system. If your system is tight in resources, you might want to consider setting the "Error Reporting" flag at "System" window to false.

Testing:

  • change TraceLevel between INFO and WARNING and note the difference in memory consumption.

Environment

None

Activity

Heng Sin Low
April 21, 2021 at 12:07 PM

If you need it, you can just revert it. It doesn’t break anything other than it is just bad for performance and memory usage.

Carlos Ruiz
April 21, 2021 at 11:40 AM

Hi ,

The change here broke a plugin from :
https://github.com/bxservice/de.bayen.freibier/blob/01d61e3fd58b3c87003403be0bfac08005dea010/de.bayen.freibier/src/de/bayen/freibier/util/AbstractRecordProcessor.java#L192

Thomas used this context variable to let a process know the SQL that the user constructed with Find in a window.

Via a process parameter he's passing the SQL, as he didn't find other way to connect the process with the dataset from the window that was called.

The workaround to solve temporarily that problem was to set the log level on INFO (and BTW setting log level didn't work fine, we needed a server restart to take the change).

But that is a temporary measure and we're thinking that we need the variable back - do you think is OK just to revert the IF? Or better add some SysConfig variable?

Regards,

Carlos Ruiz

Fixed

Details

Assignee

Reporter

Components

Fix versions

Priority

Created July 18, 2020 at 6:46 AM
Updated June 1, 2021 at 6:06 PM
Resolved April 28, 2021 at 9:42 AM