From f056b9a155be8a140d6e4b4355a4361599ff403e Mon Sep 17 00:00:00 2001 From: George Politis Date: Wed, 1 Jun 2016 11:13:42 -0500 Subject: [PATCH] Makes an executor static. Makes the CallStatsConferenceStatsHandler.statisticsExecutor static. We have run into a situation where we create many executors that storm the callstats object, resulting in an OOM. Making this static should prevent this from happening in the future, if we mess this up again. --- .../CallStatsConferenceStatsHandler.java | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/main/java/org/jitsi/videobridge/eventadmin/callstats/CallStatsConferenceStatsHandler.java b/src/main/java/org/jitsi/videobridge/eventadmin/callstats/CallStatsConferenceStatsHandler.java index efa75dcd9c..a314cca489 100644 --- a/src/main/java/org/jitsi/videobridge/eventadmin/callstats/CallStatsConferenceStatsHandler.java +++ b/src/main/java/org/jitsi/videobridge/eventadmin/callstats/CallStatsConferenceStatsHandler.java @@ -50,6 +50,14 @@ class CallStatsConferenceStatsHandler private static final MediaType[] MEDIA_TYPES = { MediaType.AUDIO, MediaType.VIDEO }; + /** + * The {@link RecurringProcessibleExecutor} which periodically invokes + * generating and pushing statistics per conference for every Channel. + */ + private static final RecurringProcessibleExecutor statisticsExecutor + = new RecurringProcessibleExecutor( + CallStatsConferenceStatsHandler.class.getSimpleName() + + "-statisticsExecutor"); /** * The entry point into the callstats.io (Java) library. @@ -66,15 +74,6 @@ class CallStatsConferenceStatsHandler */ private String conferenceIDPrefix; - /** - * The {@link RecurringProcessibleExecutor} which periodically invokes - * generating and pushing statistics per conference for every Channel. - */ - private final RecurringProcessibleExecutor statisticsExecutor - = new RecurringProcessibleExecutor( - CallStatsConferenceStatsHandler.class.getSimpleName() - + "-statisticsExecutor"); - /** * List of the processor per conference. Kept in order to stop and * deRegister them from the executor.