Skip to content

Commit 5e35e79

Browse files
Squashed commit of the following:
RTSDK-6583: Update to EMAJ Config Guide for global parameter added for RTSDK-6411 RTSDK-6583: Upticking version to 3.6.6.1 for 2.0.6.G1 release RTSDK-6583: Update to CHANGELOG for release 2.0.6.G1 RTSDK-6411: Memory leak upon repeated init and un-init of OMMConsumer due to a growing global pool
1 parent 7e4932e commit 5e35e79

File tree

14 files changed

+184
-43
lines changed

14 files changed

+184
-43
lines changed

Java/CHANGELOG.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,33 @@ There are three types of RTSDK releases that append a letter directly followed b
99
"E" releases (E-Loads) are emergency RTSDK releases that are uploaded to MyRefinitiv and Developer Community but not to GitHub. Also note that emergency releases may only be partial (i.e., Java or C++/C only).
1010

1111
----------------------------------------------------------------------------------------
12-
CURRENT RELEASE HIGHLIGHTS - RTSDK Java 2.0.6.L1 aka EMA/ETA 3.6.6.L1 aka 3.6.6.0
12+
CURRENT RELEASE HIGHLIGHTS - RTSDK Java 2.0.6.G1 aka EMA/ETA 3.6.6.G1 aka 3.6.6.1
1313
----------------------------------------------------------------------------------------
1414

15-
This is a maintenance release with fixes.
15+
This is a rapid release with a critical fix.
1616

1717
Customer Issues Resolved
1818
----------------------------------------------------------------------------------------
19-
[Case Number: 10825196] - [RTSDK-5901] - NullPointerException with emaj 3.6.1.2 processing directory domain message
19+
- [Case Number: 11444081] - [RTSDK-6411] - Memory leak upon repeated init and un-init of OMMConsumer due to a growing global pool
2020

2121

2222
----------------------------------------------------------------------------------------
2323
FULL CHANGELOG
2424
----------------------------------------------------------------------------------------
2525

26+
--------------------------------------------
27+
RTSDK Java Release 2.0.6.G1 (Sep 16, 2022)
28+
--------------------------------------------
29+
This is a rapid release with a critical fix.
30+
31+
EMA Java 3.6.6.L1 Issues Resolved
32+
---------------------------------
33+
- [RTSDK-6411] - Memory leak upon repeated init and un-init of OMMConsumer due to a growing global pool [Case Number: 11444081]
34+
2635
--------------------------------------------
2736
RTSDK Java Release 2.0.6.L1 (Jun 20, 2022)
2837
--------------------------------------------
38+
This is a maintenance release with fixes.
2939

3040
EMA Java 3.6.6.L1 Issues Resolved
3141
---------------------------------

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/ConfigManager.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ class ConfigManager
123123
public static final int ChannelType = 104;
124124
public static final int ChannelInitTimeout = 105;
125125
public static final int ServiceDiscoveryRetryCount = 106;
126+
public static final int JsonConverterPoolsSize = 107;
126127

127128
// Channel: Socket, HTTP, Encrypted, WebSocket
128129
public static final int ChannelCompressionThreshold = 200;
@@ -561,6 +562,7 @@ class ConfigManager
561562
GlobalConfigDict.add( "ReactorMsgEventPoolLimit",ReactorMsgEventPoolLimit );
562563
GlobalConfigDict.add( "TunnelStreamMsgEventPoolLimit", TunnelStreamMsgEventPoolLimit);
563564
GlobalConfigDict.add( "TunnelStreamStatusEventPoolLimit", TunnelStreamStatusEventPoolLimit );
565+
GlobalConfigDict.add("JsonConverterPoolsSize", JsonConverterPoolsSize);
564566

565567
CONSUMER_GROUP = ConfigManager.acquire().new Branch();
566568
CONSUMER_GROUP.add(ConfigManager.ConsumerGroup,ConfigManager.ConsumerTagDict);
@@ -788,7 +790,8 @@ class ConfigManager
788790
"CloseChannelFromConverterFailure",
789791
"OpenLimit",
790792
"OpenWindow",
791-
"LoadFactor"
793+
"LoadFactor",
794+
"JsonConverterPoolsSize"
792795
};
793796
public static String DoubleValues[] = {
794797
"TokenReissueRatio"

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/DataDictionaryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,7 @@ private EnumTypeTableImpl getEnumTypeTable(com.refinitiv.eta.codec.EnumTypeTable
10641064
return enumTypeTableImpl;
10651065
}
10661066

1067-
private void clearFlags()
1067+
void clearFlags()
10681068
{
10691069
loadedFieldDictionary = false;
10701070
loadedEnumTypeDef = false;

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/FieldListImpl.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,13 @@ public <T> T[] toArray(T[] a)
203203
{
204204
throw new UnsupportedOperationException("FieldList collection doesn't support this operation.");
205205
}
206+
207+
@Override
208+
public void returnToPool()
209+
{
210+
_dataDictionaryImpl.rsslDataDictionary(null);
211+
_dataDictionaryImpl.clearFlags();
212+
}
206213

207214
String toString(int indent)
208215
{

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/GlobalConfig.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@
1010
class GlobalConfig
1111
{
1212
final static int DEFAULT_EVENT_POOL_LIMIT = -1;
13+
static final int JSON_CONVERTER_DEFAULT_POOLS_SIZE = 10;
1314

1415
int reactorMsgEventPoolLimit;
1516
int reactorChannelEventPoolLimit;
1617
int workerEventPoolLimit;
1718
int tunnelStreamMsgEventPoolLimit;
1819
int tunnelStreamStatusEventPoolLimit;
20+
int jsonConverterPoolsSize;
1921

2022
GlobalConfig()
2123
{
@@ -25,6 +27,7 @@ class GlobalConfig
2527
workerEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
2628
tunnelStreamMsgEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
2729
tunnelStreamStatusEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
30+
jsonConverterPoolsSize = JSON_CONVERTER_DEFAULT_POOLS_SIZE;
2831
}
2932

3033
void clear()
@@ -34,5 +37,6 @@ void clear()
3437
workerEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
3538
tunnelStreamMsgEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
3639
tunnelStreamStatusEventPoolLimit = DEFAULT_EVENT_POOL_LIMIT;
40+
jsonConverterPoolsSize = JSON_CONVERTER_DEFAULT_POOLS_SIZE;
3741
}
3842
}

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/OmmBaseImpl.java

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,53 @@ static class ImplementationType
7575
long nextLongId();
7676

7777
void channelInformation(ChannelInformation ci);
78+
79+
default int getJsonConverterPoolsSize(ConfigElement configElement, BaseConfig baseConfig, StringBuilder stringBuilder,
80+
Logger loggerClient) {
81+
String jsonConverterPoolsSizeValue = configElement._valueStr;
82+
83+
try {
84+
if (jsonConverterPoolsSizeValue == null || jsonConverterPoolsSizeValue.isEmpty())
85+
return GlobalConfig.JSON_CONVERTER_DEFAULT_POOLS_SIZE;
86+
87+
long jsonConverterPoolsSize = Long.parseLong(jsonConverterPoolsSizeValue);
88+
89+
if (jsonConverterPoolsSize < 0) {
90+
if (loggerClient.isWarnEnabled())
91+
{
92+
stringBuilder.append("JsonConverterPoolsSize value should be equal or greater than 0.")
93+
.append(" It will be set to default value: 10.");
94+
loggerClient.warn(formatLogMessage(baseConfig.instanceName, stringBuilder.toString(), Severity.WARNING));
95+
}
96+
return GlobalConfig.JSON_CONVERTER_DEFAULT_POOLS_SIZE;
97+
}
98+
99+
if (jsonConverterPoolsSize > Integer.MAX_VALUE) {
100+
if (loggerClient.isWarnEnabled())
101+
{
102+
stringBuilder.append("JsonConverterPoolsSize value should not be greater than ")
103+
.append(Integer.MAX_VALUE)
104+
.append(". It will be set to ")
105+
.append(Integer.MAX_VALUE)
106+
.append(".");
107+
loggerClient.warn(formatLogMessage(baseConfig.instanceName, stringBuilder.toString(), Severity.WARNING));
108+
}
109+
return Integer.MAX_VALUE;
110+
}
111+
112+
return (int) jsonConverterPoolsSize;
113+
} catch (NumberFormatException exception) {
114+
if (loggerClient.isWarnEnabled())
115+
{
116+
stringBuilder.append("invalid JsonConverterPoolsSize value format [")
117+
.append(jsonConverterPoolsSizeValue)
118+
.append("]; expected number. It will be set to default value - 10.");
119+
loggerClient.warn(formatLogMessage(baseConfig.instanceName, stringBuilder.toString(), Severity.WARNING));
120+
}
121+
}
122+
123+
return GlobalConfig.JSON_CONVERTER_DEFAULT_POOLS_SIZE;
124+
}
78125
}
79126

80127
abstract class OmmBaseImpl<T> implements OmmCommonImpl, Runnable, TimeoutClient, ReactorServiceNameToIdCallback, ReactorJsonConversionEventCallback
@@ -941,6 +988,11 @@ void readConfiguration(EmaConfigImpl config)
941988
{
942989
_activeConfig.globalConfig.tunnelStreamStatusEventPoolLimit = ce.intValue();
943990
}
991+
if( (ce = globalConfigAttributes.getPrimitiveValue(ConfigManager.JsonConverterPoolsSize)) != null)
992+
{
993+
_activeConfig.globalConfig.jsonConverterPoolsSize =
994+
getJsonConverterPoolsSize(ce, _activeConfig, strBuilder(), _loggerClient);
995+
}
944996
}
945997

946998
ProgrammaticConfigure pc = config.programmaticConfigure();

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/OmmConsumerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@ void handleAdminDomains(EmaConfigImpl config) {
576576
jsonConverterOptions.catchUnknownJsonKeys(_activeConfig.catchUnknownJsonKeys);
577577
jsonConverterOptions.catchUnknownJsonFids(_activeConfig.catchUnknownJsonFids);
578578
jsonConverterOptions.closeChannelFromFailure(_activeConfig.closeChannelFromFailure);
579+
jsonConverterOptions.jsonConverterPoolsSize(_activeConfig.globalConfig.jsonConverterPoolsSize);
579580

580581
if (_rsslReactor.initJsonConverter(jsonConverterOptions, _rsslErrorInfo) != ReactorReturnCodes.SUCCESS) {
581582
strBuilder().append("Failed to initialize OmmBaseImpl (RWF/JSON Converter).")

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/OmmServerBaseImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ void initialize(ActiveServerConfig activeConfig,EmaConfigServerImpl config)
285285
jsonConverterOptions.catchUnknownJsonKeys(activeConfig.catchUnknownJsonKeys);
286286
jsonConverterOptions.catchUnknownJsonFids(activeConfig.catchUnknownJsonFids);
287287
jsonConverterOptions.closeChannelFromFailure(activeConfig.closeChannelFromFailure);
288+
jsonConverterOptions.jsonConverterPoolsSize(activeConfig.globalConfig.jsonConverterPoolsSize);
288289

289290
if (_rsslReactor.initJsonConverter(jsonConverterOptions, _rsslErrorInfo) != ReactorReturnCodes.SUCCESS) {
290291
strBuilder().append("Failed to initialize OmmServerBaseImpl (RWF/JSON Converter).")
@@ -722,6 +723,11 @@ void readConfiguration(EmaConfigServerImpl config)
722723
{
723724
_activeServerConfig.globalConfig.tunnelStreamStatusEventPoolLimit = ce.intValue();
724725
}
726+
if( (ce = globalConfigAttributes.getPrimitiveValue(ConfigManager.JsonConverterPoolsSize)) != null)
727+
{
728+
_activeServerConfig.globalConfig.jsonConverterPoolsSize =
729+
getJsonConverterPoolsSize(ce, _activeServerConfig, strBuilder(), _loggerClient);
730+
}
725731
}
726732

727733
ProgrammaticConfigure pc = config.programmaticConfigure();

Java/Ema/Core/src/main/java/com/refinitiv/ema/access/ProgrammaticConfigure.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -600,6 +600,7 @@ GlobalConfig retrieveGlobalConfig() {
600600
ElementEntry workerEventPoolLimit = getIntElementEntry(globalConfigEntry, "WorkerEventPoolLimit");
601601
ElementEntry tunnelStreamMsgEventPoolLimit = getIntElementEntry(globalConfigEntry, "TunnelStreamMsgEventPoolLimit");
602602
ElementEntry tunnelStreamStatusEventPoolLimit = getIntElementEntry(globalConfigEntry, "TunnelStreamStatusEventPoolLimit");
603+
ElementEntry jsonConverterPoolsSize = getIntElementEntry(globalConfigEntry, "JsonConverterPoolsSize");
603604

604605
if (reactorMsgEventPoolLimit != null) {
605606
config.reactorMsgEventPoolLimit = convertToInt(reactorMsgEventPoolLimit.intValue());
@@ -616,6 +617,9 @@ GlobalConfig retrieveGlobalConfig() {
616617
if (tunnelStreamStatusEventPoolLimit != null) {
617618
config.tunnelStreamStatusEventPoolLimit = convertToInt(tunnelStreamStatusEventPoolLimit.intValue());
618619
}
620+
if (jsonConverterPoolsSize != null) {
621+
config.jsonConverterPoolsSize = getJsonConverterPoolsSize(jsonConverterPoolsSize.intValue());
622+
}
619623
return config;
620624
}
621625
void retrieveDictionaryConfig( String dictionaryName, ActiveConfig activeConfig )
@@ -3202,4 +3206,27 @@ void removeConfigFileService(DirectoryServiceStore dirServiceStore, DirectoryCac
32023206
i++;
32033207
}
32043208
}
3209+
3210+
private int getJsonConverterPoolsSize(long jsonConverterPoolsSize)
3211+
{
3212+
if(jsonConverterPoolsSize < 0)
3213+
{
3214+
_emaConfigErrList.append( "JsonConverterPoolsSize value should be equal or greater than 0.")
3215+
.append( " It will be set to default value: 10.")
3216+
.create(Severity.WARNING);
3217+
return GlobalConfig.JSON_CONVERTER_DEFAULT_POOLS_SIZE;
3218+
}
3219+
3220+
if(jsonConverterPoolsSize > Integer.MAX_VALUE)
3221+
{
3222+
_emaConfigErrList.append("JsonConverterPoolsSize value should not be greater than ")
3223+
.append(Integer.MAX_VALUE)
3224+
.append(". It will be set to ")
3225+
.append(Integer.MAX_VALUE)
3226+
.append(".")
3227+
.create(Severity.WARNING);
3228+
return Integer.MAX_VALUE;
3229+
}
3230+
return (int) jsonConverterPoolsSize;
3231+
}
32053232
}

Java/Ema/Docs/EMAJ_ConfigGuide.pdf

16.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)