[ 
https://issues.apache.org/jira/browse/SYNAPSE-991?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14101780#comment-14101780
 ] 

Hiranya Jayathilaka commented on SYNAPSE-991:
---------------------------------------------

It's been a while since I looked at the statistics collection code. But this is 
what I remember about this implementation:

Synapse server never really clears out the statistics objects collected during 
runtime. Usually, the user has to implement some kind of an extension that 
consumes statistics gathered by Synapse (a hook to a monitoring system or a 
DB). It is the responsibility of this extension to flush the statistics from 
Synapse memory, once the extension has processed the information. This is to 
make sure that Synapse does not clear out any statistics records, before they 
have been seen and processed by the user extensions. And I believe this is why 
there's a clearAllStatistics method in the API. 

But as I said, I'm a little fuzzy on the details at the moment. Perhaps Indika 
or somebody else who has been working with Synapse statistics implementation 
can explain this better than me.

> GC issue. StatisticsCollector has not been invoked by callback.
> ---------------------------------------------------------------
>
>                 Key: SYNAPSE-991
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-991
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1
>         Environment: Production environment.
> wrapper.java.initmemory=2048
> wrapper.java.maxmemory=2048
> wrapper.java.additional.12=-XX:NewSize=1024m 
> wrapper.java.additional.13=-XX:MaxNewSize=1024m
> wrapper.java.additional.14=-XX:PermSize=256m
> wrapper.java.additional.15=-XX:MaxPermSize=256m 
> wrapper.java.additional.16=-XX:SurvivorRatio=65536
> wrapper.java.additional.17=-XX:TargetSurvivorRatio=0
> wrapper.java.additional.18=-XX:MaxTenuringThreshold=0
> wrapper.java.additional.19=-XX:+UseParNewGC
> wrapper.java.additional.20=-XX:ParallelGCThreads=12
> wrapper.java.additional.21=-XX:+UseConcMarkSweepGC
> wrapper.java.additional.22=-XX:+CMSParallelRemarkEnabled
> wrapper.java.additional.23=-XX:+CMSCompactWhenClearAllSoftRefs
> wrapper.java.additional.24=-XX:+UseCMSInitiatingOccupancyOnly
> wrapper.java.additional.25=-XX:CMSInitiatingOccupancyFraction=85
>            Reporter: Arockia Raphael
>            Assignee: Hiranya Jayathilaka
>            Priority: Minor
>
> Production server was up with all synapse services for the past 2 months. GC 
> could not be able to reclaim the memory in Old Gen which of size close to 1 
> GB. Based on our heap dump analysis, StatisticsCollector was holding the 
> memory and manually invoked StatisticsViewMBean.clearAllStatistics() method 
> to get rid of the issue. 
> When we analysed the code, we found out the StatisticsCollector has never 
> been called when the server in Started State. Periodic callbacks are 
> scheduled but not triggering StatisticsCleaner which cleans up 
> StatisticsCollector references.
> SynapseConfigUtils.getStatisticsCollector(ServerContextInformation 
> contextInfo) {
>         if (contextInfo != null && contextInfo.getServerState() == 
> ServerState.INITIALIZED) {
> Please let us know any patch or fix for this issue.
> Thanks,
> Arockia



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to